I2C with internal GPIO pull-up

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

I2C with internal GPIO pull-up

Jump to solution
1,908 Views
gschelotto
Contributor V

Hi,

Is there any way to use I2C KL03Z peripheral with the internal GPIOs pull-up for the SDA & SCL lines? If so, how can I do this?

I've forgot to put the external ones in my custom board... :~(

Thanks in advance,
gaston

1 Solution
1,723 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gaston Schelotto,

  Please also note, PTB3 and PTB4 is the true open drain pins, if you are using these two pins, you must add the external pull up resistor.

 Even with the internal pull up, in the practical project, it's better to add the external pull up resistor.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
3 Replies
1,723 Views
BlackNight
NXP Employee
NXP Employee

You have to check the data sheet of the KL03Z how strong the pull-ups are. Typically they will be in the 100kOhm range, so while it 'can work', I never would use that in a product as they are too weak. It is simply not reliable. Depending on the devices on your bus and the lines, typically you need something in the 4.7-10k range. See as well http://www.ti.com/lit/an/slva689/slva689.pdf 

I hope this helps,

Erich

1,723 Views
gschelotto
Contributor V
As one colleague would say: It's not a mistake, it's just a Hardware optimization.
You're right. I'd need external pull-up resistors in the 4k7-10k range, as usual...
However, I have planned to investigate a little more to see how far I can go. The fact is that I'm finally able to use the I2C bus successfully and reliably using the internal pull-up. Of course, under certain considerations I will explain below.
  1. Internal pull-up strength of KL03Z. Luckily, for this device family, they fall in the range of 20k-50kSelection_024.png
  2. Bus capacitance and rise time: In my application, it is a single master-slave I2C bus without branches and with a length of 2mm (the microprocessor and the slave are placed together). Therefore I can have a very small capacity that I can estimate in about 4pF+ 8pF x 2 of devices pin capacitance (Cb total 20pF). For the maximum rise time of SDA/SCL lines, the I2C spec for the standard mode (100KHz) is tr_max = 1000ns. Then the max pull-up resistance is Rpu_max = tr_max / (Cb x 0.8473) = 59k
  3. Finally, I don't need to go at 100KHz. For my application 10kHz is enough. Here's some results of the bus lines.pic_420_1.gifpic_420_2.gif

Thanks for the given hints!

regards,
gaston

0 Kudos
1,724 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Gaston Schelotto,

  Please also note, PTB3 and PTB4 is the true open drain pins, if you are using these two pins, you must add the external pull up resistor.

 Even with the internal pull up, in the practical project, it's better to add the external pull up resistor.


Have a great day,
Kerry

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos