Can you use p27 as a digital output on LPC11U24?

18 Dec 2012

Quick one I think.

Can you use p27 as a digital output on the LPC11U24?

The documentation on DigitalOut seems to suggest you can. However, I'm driving a 7 segment display and intended to use pins 21 to 27 to drive the segments (segment A to segment G) and it all worked except for segment G. When I move segment G output from p27 to p29 it is fine.

Is the I2C peripheral getting in the way?

19 Dec 2012

https://mbed.org/users/Lerche/notebook/lpc11u24-pin-functions/

P27 and P28 are open-drain. It's not possible to pull those high.

Lerche

19 Dec 2012

Hi All,

Its always been a little bit inconvenient that the only I2C bus on the LPC11U24 has proper open drain pins, as it does rather confuse things when using the same pins as GPIO.

Of course you can pull the pin high with an external pull up, but that still no good for driving current at high level.

If you're running low on pins, you could consider using common anode displays which will work just as well on the open drain pins.

Thanks, Chris

19 Dec 2012

Oh. OK. No problem. Its only a bit of a lashup at the moment. Actually I'm using parts of a Velleman digital clock kit so I don't have much choice regarding common cathode or common anode. Good to know anyway.

20 Dec 2012

You could insert a P-channel MOSFET with a simple pull-up on the gate,
then you'll have and inverted, but useful output.

Lerche

You need to log in to post a reply