Understanding the AT89S52’s pin configuration #2

Thread Starter

Sachin hai

Joined Dec 16, 2024
1
I have a problem with AT 89S52. I an not used pins as output high but they still give HIG why? Please help to fix it
 

Papabravo

Joined Feb 24, 2006
22,058
I have a problem with AT 89S52. I an not used pins as output high but they still give HIG why? Please help to fix it
You have hijacked another user's thread, and that user has not been seen for over 4.5 years.

The answer to your question is that ALL 8051 parts, and their clones by other manufacturers, have quasi-bifdrectional pins on all ports except Port 0. Port 0 pins ara all open-drain. They MUST have external pullip resistors for them to function as outputs.

The pins on ALL the remaining ports have a weak active pullup resistor. This means the pins can be used as inputs and can be pulled high or low as the application requires. To use them as outputs all you have to do is write a '0' to the data regisrer. When you write a '1' the weak active pullup takes over. The upshot of this approach is that outputs from the pins of the 89S52 and all other members of the 8051 family CANNOT source any appreciable current. Any attempt to use an 8051 output to source current will result in a voltage drop at the output due to the impedance of the weak pullup resistor (usually implemented as a p-MOSFET on the original silicon). I reckon from a limited survey of parts that the impedance of the weak pullup is in the 40KΩ range.

ETA -- There is no firmware fix for this condition. In hardware, you could add individual inverters for each ouput that must come up in a low state
 
Last edited:
Top