Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

8051 port initialization

Status
Not open for further replies.
The answer is a bit deeper. Ports 1, 2, & 3 have output structures which are refered to as quasi-bidirectional ports. When the port data register contains a zero the N-channel output transistor can sink several milliamps of current. When the port data register contains a one there is only a weak pullup which can supply only a few tens of microamps. In this case the "output" can be overridden by another strong pulldown.

In order to use the alternate functions of port 3 you must write 1's to the bits which will be using the alternate function. The alternate function of port 2 is the high order address bits (A8-A15) which are used to access external memory and peripherals. Initializing P2 to 0xFF would be a clue that external memory or peripherals are involved.

Lastly, never forget that port 0 has "open drain" outputs. You must provide an external pullup, except when port 0 is the multiplexed address/data bus.

Is all of that just about as clear as mud in the street?
 
4electros said:
Sorry but i may need some diagram or drawing in order to understand what you said well.....

could you?!
The drawings of the port pin structures are in the datasheets. Those from Atmel www.atmel.com have been particularly helpful to me.
 
Status
Not open for further replies.

Latest threads

Back
Top