Reading the port - Little help needed
I would like to ask if someone can suggest me how should I write the following statement as the current one is not working:
Code:
While PortC=%111011 & %001000
Serout ToTx,N2400,[66]
wend
I want to check if ONLY PortC.2 is pulled low & rest are held high. I want to exclude PortC.3 from being read as it has another function attached to it. It's state (PortC.3) should not be considered. Thanks
Re: Reading the port - Little help needed
Code:
WHILE (PORTC = %11111011) OR (PORTC = %11110011)
SEROUT ToTx, N2400, [66]
WEND
Re: Reading the port - Little help needed
or
Code:
WHILE (PORTC = %11110011 | %00001000)
SEROUT ToTx, N2400, [66]
WEND
probably what you wanted to do at first ;)
Re: Reading the port - Little help needed
"| %0000100"
What does this does mister_e? I read the manual it says there that this "|" is used to set the bit. Please explain how it fits with my requirement. Thanks a lot
Re: Reading the port - Little help needed
it's all about Bitwise operations.
| is bitwise OR.
You said you don't need to monitor bit.3?
So it could be 0 or 1?
How about making sure this specific is always 1 then?