I wrote a code for to toggle the port that is given below #include<reg51.h> sbit CLOCK = P0^2; void main() { while(1) { CLOCK = CLOCK^1; } } its not toggling in the IDE please guide me Mahesh
You are going to place the c code in your hard disk or any thing else. But the opcode is going to reside in FLASH. One byte of FLASH is costlier than some 50 bytes of hard disk. And no one can pay for the execution time. Comment statements are there to give the understanding.
So try:
CLOCK ? (CLOCK = 0) : (CLOCK = 1);
CLOCK = ~CLOCK;
this is basicallt the same as
if (var = TRUE) { var = FALSE: } the above is the simple example and I can not tell how many times I have seen this idiocy/ Erik