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

Can SFRs and Sbits be defined as volatile?

sbit P07 = 0x87;
void main()
{
while(P07);    // End Program unless we get error
printf("Error - line went low");  // Print Error being recieved
for(;;)        // End after Error
}

Problem is that it never gets out of the first while loop even when P07 (Port 0, pin 7) changes states. I am using DS2252T which allows ports to be bit addressable. What am I doing wrong?

Thanks

Parents Reply Children
No data