LPC111x GPIO and other pullup question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC111x GPIO and other pullup question

3,687 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elef on Mon Dec 26 06:50:51 MST 2011
Hi,

I have 2 questions about the GPIO pin config on the LPC111x parts (mainly LPC1111 or LPC1114).

1. When set any GPIO to digital outputs, are the pullup/down automatically disabled or do we need to do this to save power? If it is written in the data sheet/User manual does anyone have the page number so i can read up on it? All i could find was the circuit diagram in chapter 11.4 of the data sheet, but it is very ambiguous, it doesnt even show the i2c pins how they differ...

2. The I2C pins have no pull up or pull down from what i can tell. We are not using these in our circuit, so they have been left unconnected. Because the default pin config is digital IO input, they are floating inputs? So to be technically correct, we either need external resistors to pull up or down, or set these as outputs in software? Is there any mention in the documents to not leave these as floating inputs or to set them as outputs in our software? obviously there is a lot of documentation i am still reading, but i have not come across this yet...

thanks!
0 Kudos
Reply
8 Replies

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elef on Fri Jan 06 05:12:01 MST 2012

Quote: Rob65

The pull up/down configurations are only valid when using the pin as input pin.



As promised, i am posting my findings regarding the pull up and pull down resistors (tested on LPC1114)

ROB65, sorry but i have to disagree. From my testing, the pull up and pull down are valid (can be turned on or off) regardless if pin is input/output (obviously in output mode they are using current internally, so you would never see any difference on the output of the pin)

When i set a GPIO to output, it does not automatically turn off the  pullup/pulldown. This means you must do it manually or it will consume  (read: WASTE) power/current. This is fine, because it is as i expected, i just wanted to confirm it!

The only test i haven't done is to check if they are still active when in pin function mode (like uart TX/RX, SPI etc) but i assume they would be. The data sheet only mentions they are disabled in A-D mode (but i haven't tested that either).

So the good news is now i know i need to turn them off, the bad news is, if i forget, i waste power, which is not a big deal for me, but thought i would let you all know incase you are making battery powered devices.

FYI: i measured about 60uA increase in Idd per pin i set to output, so if you have 20 pins set to output (and driven low with pullup, or driven high with pulldown), you waste about 1.2mA
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elef on Thu Dec 29 19:54:30 MST 2011

Quote: js-nxp

Posted a link to a video to the beast here :D http://knowledgebase.nxp.com/showthread.php?p=13520#post13520



pretty cool :)
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by js-nxp on Wed Dec 28 21:02:22 MST 2011

Quote:
I'm assuming you used an A-D for this?

Yes, 2 of them. But depending on whether you are reading the X or Y value their relative high drive digital pin has to go into high impedance mode.

Posted a link to a video to the beast here :D http://knowledgebase.nxp.com/showthread.php?p=13520#post13520
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elef on Wed Dec 28 20:40:53 MST 2011

Quote: js-nxp
I just got a resistive touchpad going and you just want the pin as an input without anything else attached to the pin ie a floating input pin.



I'm assuming you used an A-D for this? if so, it says in the manual that the digital input and the pullup/down resistors are not used when using the pin for A-D.

So i guess my only question now is, what happens when the pin is digital output? are the pullup/down turned off automatically, or do we need to turn them off in software?
will let you all know asap once my kit arrives and i can test it :)
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by js-nxp on Wed Dec 28 20:13:22 MST 2011

Quote:
you that you should [B]always [/B]enable either pull up/down or configure a pin as output.

ALWAYS?? :) I just got a resistive touchpad going and you just want the pin as an input without anything else attached to the pin ie a floating input pin. Don't know the resistance of the resistors but they could affect the values read back otherwise.
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elef on Wed Dec 28 15:52:47 MST 2011

Quote: Rob65
On your question 1:
The pull up/down configurations are only valid when using the pin as input pin.
.....

I never measured if enabling pull up resistors does increase power consumption when using the pins as an output with low level. Maybe this is described in the aforementioned application note. If not it might be worth testing this.

Rob



Thank you both for your answers.
i have a kit hopefully arriving in the next few days, so i can tell you how it goes!

regarding your comment above, i couldn't find anywhere in the manual that enabling an output turns off the pull up/down.

Thanks.
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Dec 28 15:43:23 MST 2011
On your question 1:

check figures 24 and 25 in the datasheet. These show you current vs. voltage with both low level output current and high level output current.
Being able to drive > 10 mA in both high and low situations must mean that a GPIO pin configured as output has a push-pull output.
The pull up/down configurations are only valid when using the pin as input pin.

2. The I2C pins are indeed floating when not used. You should provide an external pull up resistor on those signals or set them as output when not being used to save power.

There is even more documentation to read ... If you look at the support pages for the lpc1114 on the nxp website you'll find an application note on power management that tells you what to do to save power (and use the different sleep and power down modes).
That application note tells you that you should always enable either pull up/down or configure a pin as output.

I never measured if enabling pull up resistors does increase power consumption when using the pins as an output with low level. Maybe this is described in the aforementioned application note. If not it might be worth testing this.

Rob
0 Kudos
Reply

2,805 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by js-nxp on Wed Dec 28 15:01:56 MST 2011

Quote:
When set any GPIO to digital outputs, are the pullup/down automatically disabled

You need to use the LPC_IOCON to change the state of the pullup\pulldown\disable for the I\O pins. Bits 3 and 4
#define Digital_function 7 // 1  Digital, 0 Analogue
//Next 2 bits 0 0 pin inactive. 1 1 Bus keeper
#define Pull_up_bit 4  // 1 Enables pull up
#define Pull_down_bit 3  // 1 Enables pull down
0 Kudos
Reply