The ports on an 8051, except for P0, are inherently quasi-bidirectional. P0 has open drain outputs. They have no configuration register, only a data register. If a pin is to be used as an input you must write a one to the output data latch which is part of the SFR registers P0, P1, P2, and P3. If you want to use P0 as an input you need to write a one there also to turn off the low side N-channel switch.Thanks for the explanation. It brought another question to mind:
Would there be any good reason to not set all the ports to be Quasi-bidirectional? why use external pull up resistor when theres internal ones.
thanks
yeti
by Duane Benson
by Jake Hertz
by Dale Wilson
by Aaron Carman