Pulled-up to 2.3V?

17 Jun 2011

Hello,

My name is Ryan. I have a question about the mbed's GPIO pins. With a blank program (so all the IO pins should be pulled-up), I measure the voltage between an IO pin and GND I measure approximately 2.3V. I also get 2.3V if I enable a pullup on the pin with this program:

#include "mbed.h"
DigitalIn p(p21);

int main() {
    p.mode(PullUp);
}

I was expecting to get 3.3V because NXP's block diagrams for how the LPC17XX work show a "weak pull-up" is connected to VDD, which is the same as where the "strong pull-up" is connected to. Is 2.3V correct? Are my two mbeds damaged?

- Ryan

18 Jun 2011

Your main function executes and the program ends. I am not sure what state the pins are when the program is finished executing. Try adding a while (1) loop after p.mode.

#include "mbed.h"
DigitalIn p(p21);

int main() {
    p.mode(PullUp);
    while (1){
       ; //do nothing
    }
}

This will ensure that the program is still running on the LPC1768 (even though the program does not do anything useful).

21 Jun 2011

Hello, Igor.

Thank you for your response. My multimeter still reads 2.3V between pin 21 and GND with your code. Do expect the mbed to be pulling the pin up to 3.3V?

- Ryan

23 Jun 2011

I just did the measurement myself and I got the same result. I suspect that we see that voltage because when you measure p21 (or any other pin) to ground, you form a voltage divider between the internal resistance of your meter and the pull up resistance of the pin. If you measure the voltage from p21 to VOUT, you get zero volts (because there is very very very little current across the internal pull up resistor)

To get 2.3V at the pin, it means that the pull up resistance is about half of the meter resistance. Most meters have a rather large input resistance when measuring voltage to prevent exactly this effect, but it seems the pull up resistor is very large itself! Maybe someone with a higher quality meter (i.e. higher impedance) can help us out...

Personally, I wouldn't rely on such a high pullup resistance and would use external resistance if possible.

23 Jun 2011

I use this datasheet http://ics.nxp.com/products/lpc1000/datasheet/lpc1763.lpc1764.lpc1765.lpc1766.lpc1767.lpc1768.lpc1769.pdf chapter 10 shows the input currents. For an input without pull up/down this is typ.0.5nA, not nearly enough for any significant voltage across a multimeter. Even the max. of 10nA gives only 10mV across 1M. The characteristic with pull-up is shown in fig.13. From that diagram you can tell that @2.3V the input current is -30uA. This would mean that the impedance of the multimeter is 2.3/30 ~ 75k. This is quite low and can only be found in analog multimeters (15k/V). So there are two strange things: the current seems to be independent of the pull-up setting and the actual current is (probably) too high for no pull-up or too low for the pull-up of fig.13.

24 Jun 2011

Yes, I had a look at that. I think that simply means that the input before the pull-up/down circuitry within the uC leaks 0.5nA. That has nothing to do with our measurement. We are measuring from the outside in.

/media/uploads/igor_m/pin.gif

If nothing is plugged in and we are in pull up mode, current is gonna flow through Ru and into Rin. I think this is what's specified in the datasheet. Once we insert a meter in the circuit, we form a voltage divider with Rm and Ru. At this point, the current flowing through Rin is not really consequential. Either way, the 2.3V is gonna appear. I don't see anything else that can explain the 2.3V