Maybe someone can help me out...???? I am having the following problem.... I am using in- and outputs on P1 of a 87C51R+ micro. As far as I can tell I have correctly set the inputs of the port by sending a "1" to them. Even though it all seems to function in dscope, it doesn't on the micro board. example:
sfr trigger = P1^0;
if(trigger == 1){ ........ }
By default, all lines of P1 are set as inputs. The following code:
if(trigger & 0x01){ ........ }
Hi John, change
sbit trigger = P1^0;
p.s. The "^0" syntax only means "bit zero" in an sbit declaration. Anywhere else, it means "XOR 0", so:
sfr trigger = P1;