??? 05/01/06 21:31 Read: times |
#115309 - '51 port behaviour Responding to: ???'s previous message |
It might be not related to Pinnacle at all - the behaviour of '51 port is, that if you write e.g. #1 into port 0 (mov p0,#1), you set bit 0 of port 0 (P0.0) to "not driven low" (assuming you have an external pullup it means it is high), all other bits of port 0 are driven low by the output transistors. It means, you cannot drive them high externally and if you perform mov a,P0 , you can read only either 1 (if nothing drives low P0.0) or 0 (if something drives P0.0 low).
I assume you planned to read back some of the port 0 pins, e.g. P0.4-P0.7; you then need to write #0F1h, #0F2h etc. to keep the pins P0.4-P0.7 in the "not driven low" state. Also, please reread the "bible", the "ports structure" chapter. Jan Waclawek |
Topic | Author | Date |
Pinnacle 52 & Ports | 01/01/70 00:00 | |
I had trouble too | 01/01/70 00:00 | |
My project options | 01/01/70 00:00 | |
Problem | 01/01/70 00:00 | |
it's not 3x3 | 01/01/70 00:00 | |
Thank you.![]() | 01/01/70 00:00 | |
Thank you. | 01/01/70 00:00 | |
A buggy program? | 01/01/70 00:00 | |
'51 port behaviour | 01/01/70 00:00 | |
(+) | 01/01/70 00:00 |