The pins in Port 1 has internal pull-ups when used for input. The Mosfet is off and the drain is pulled high using an internal pull-up resister.

enter image description here

I connect an ammeter and see that the current (IL current) flowing to ground is about 15uA. I inferred that the value of the internal pull-up resister is 333k.

Now I connect a 10k resister and measure the current. I get 0.5mA (5/10k). What happened to the internal pull-up resister? Is not the internal pull-up resister and the 10k resister in series?

enter image description here

What is happening? When I use external pull-up at Port 0, things appear as expected - Resisters in series and both resisters acting as voltage divider to create a voltage drop at the pin.

ps: I am using AT89s52.

ps: The same problem exists in port 2,3

ps: Here is the current for different resisters:

- 330 ohms - 15uA
- 1k - 15uA
- 100k - 50uA 
- 220k - 22uA

The Max IL (as per datasheet) is -50uA

  • \$\begingroup\$ What happens if you change the 10k resistor for 4k7 or 2k2? \$\endgroup\$ – jippie May 24 '13 at 14:43

This is an informed guess rather than a definite answer, but I suspect there isn't a resistor there at all: resistors take up a lot of area in CMOS and aren't very accurate. Instead there will be a small current source made out of MOSFETs and limited to 50uA. It might be non-linear to guarantee that, no matter what pulldown you connect, the input is close to one rail or the other.

  • \$\begingroup\$ Thanks. I guess you are right. Either that, or something supernatural. What is amazing is that datasheet does not say more than, it to be a pullup resistor. \$\endgroup\$ – Arjob Mukherjee May 24 '13 at 18:34

protected by W5VO May 24 '13 at 14:14

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.