P0 problem

Thread Starter

tush

Joined Aug 31, 2008
1
i have problem with port P0 in 89c51.

P0=0x01;
P0=P0<<1;

when i do this operation P0.1 become low.

what can i do
 

Papabravo

Joined Feb 24, 2006
14,196
i have problem with port P0 in 89c51.

P0=0x01;
P0=P0<<1;

when i do this operation P0.1 become low.

what can i do
When you do an operation like this you ar reading the value of the PIN, not the contents of the output data latch. You gotta understand how an I/O port works before you can actually use it.

The other poster is correct. On all the 8051's that you will ever see, besides all the ones that you won't, Port 0 has OPEN COLLECTOR OUTPUTS, which need an external pullup resistor in order to output a '1'.
 
Top