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.
testpin = !testpin Have you tried
testpin = ~testpin;
Have you configured the start167.a66 file and added it to your project? Since P1L.0 is also A0, the default configuration will configure the chip for non-multiplexed mode. Keil Support
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; }