This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Primitive problem

I have assembled a simple scheme, my eval board: 164CI, address latch, 32kB RAM on CS0. Then I put cristall in BSL mode and downloaded Keil user167 monitor. Next monitor dowloaded my program as follows:

#include <reg164.h>
sbit tpindir = DP1L^0;
sbit testpin = P1L^0;

void main (void) {

tpindir = 1;
while(1) testpin = !testpin;
}

Everything's running ok - only in debbuger. Pin state doesn't change. Does enyone has idea - why?

Roman. Russia.

Parents
  • There are many ways to toggle a pin.
    My preferred way is
    1>
    while(condition)
    {
    testpin=~testpin;
    }
    //remember ~ is a bit operator.

    2> This is when each pin is not separately defined. One can toggle any bit by xor operation on the port with the bit location under consideration equal to 1.


    while(condition)
    {
    testport=^0x01;
    }

Reply
  • There are many ways to toggle a pin.
    My preferred way is
    1>
    while(condition)
    {
    testpin=~testpin;
    }
    //remember ~ is a bit operator.

    2> This is when each pin is not separately defined. One can toggle any bit by xor operation on the port with the bit location under consideration equal to 1.


    while(condition)
    {
    testport=^0x01;
    }

Children
No data