Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 months ago.
Using I2C open drain pins as DigitalOutputs
Hi, Couple days before I started playing with mbed LPC1114FN28 and found one issue. I'm not able to use dp5 and dp27 (I2C open drain pins) as DigitalOutputs. Code is compiling, but direct measure of voltage gives always GND voltage there. Any reason for that?
Thanks in advance, Fosfor
Question relating to:
1 Answer
9 years, 11 months ago.
Did you add external pullups?
By definition an open drain output can only drive to GND, it can never drive the line high. If you want an open drain output to go high you need to add an external pullup.
Thanks for quick reply, what should be value of such pullup resistor?
Regards, TH
posted by 15 Dec 2014Depends on the speed of the signals involved and what's connected.
A low value will give sharper rising edges but will use more power and raise the low level slightly above 0V. A high value will result in rounded rising edges and depending on the signal loading lower high voltages.
As a general rule, a couple of kOhms for a high speed signal, 10-47k for a low speed or effectively DC signal.
posted by 15 Dec 2014