in 8051 we use port0 as I/O port or addressdata bus?

Status
Not open for further replies.

logukalipal

Junior Member level 2
Joined
Jan 8, 2012
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Coimbatore, India
Visit site
Activity points
1,476
Hi..!

beginners voice: can we use port0 of 8051 as Input/Output port or AddressData port only?

If we can use both I/O port and AddrData port means, how i use?
 

Port 0: Port 0 occupies a total of 8 pins (pins 32-39) .It can be used for input or output. To use the pins of port 0 as both input and output ports, each pin must be connected externally to a 10K ohm pull-up resistor. This is due to the fact that P0 is an open drain, unlike P1, P2, and P3.Open drain is a term used for MOS chips in the same way that open collector is used for TTL chips. With external pull-up resistors connected upon reset, port 0 is configured as an output port. For example, the following code will continuously send out to port 0 the alternating values 55H and AAH



**broken link removed**


Dual role of port 0: Port 0 is also designated as AD0-AD7, allowing it to be used for both address and data. When connecting an 8051/31 to an external memory, port 0 provides both address and data. The 8051 multiplexes address and data through port 0 to save pins. ALE indicates if P0 has address or data. When ALE = 0, it provides data D0-D7, but when ALE =1 it has address and data with the help of a 74LS373 latch.
 
Thanks a lot...
Now my question is, In 8051 can i use port0 as both I/O and Addressdata port using any method?

(i.e)Now i interfaced the external memory so am used port0 as addr data port using latch. now i need a I/O port, so i ask using any technic we use the same port0 as I/O port?

[OR]
We use only port0 as In/Out port else Addressdata port?

Thanks in advance..
 
Last edited:

Thanks a lot..

Ans is:

Port-0 can be configured as a normal bidirectional I/O port or it can be used for address/data interfacing for accessing external memory. When control is '1', the port is used for address/data interfacing. When the control is '0', the port can be used as a normal bidirectional I/O port.

- - - Updated - - -

Thanks a lot..

Ans is:

Port-0 can be configured as a normal bidirectional I/O port or it can be used for address/data interfacing for accessing external memory. When control is '1', the port is used for address/data interfacing. When the control is '0', the port can be used as a normal bidirectional I/O port.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…