cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F051K8, I2C pull-ups

Enzo Guerra
Associate
Posted on January 20, 2017 at 12:39

hello

started STM32CubeMX and selected the stm32f051k..,

then added the  i2c peripheral and then selected the configuration->connectivity->i2c1 and finally gpio settings

noticed that the GPIO Pull-up/Pull-down drop down boxed could be selected for SDA and SCL

is this selection valid?

could the board pull-up resistors be eliminated?

checked the schematic of the stm32f0 discovery board (MB1034.pdf) did not notice any pull up on pins pb6, pb7 or pb10, pb 11

please let me know

regards

enzo

4 REPLIES 4
Posted on January 20, 2017 at 13:27

The internal pullup is usually too weak resulting in high RC constants with the connected devices' and the traces' parasitics, thus limiting communication speed; that's why external pullups are usually used. They are not present on the Disco board as there is no onboard I2C peripheral and they would potentially interfere with other possible use of the board.

JW

Posted on March 21, 2017 at 20:38

Hi JW,

I was looking for this kind of answer. It was helpful thanks.

I am not an OP, but I have a question. Does 'the internal pullup is usually too weak' mean the resistance is a way too high (around 40k from datasheet) for communication?

Posted on March 22, 2017 at 09:20

Well, the parasitic capacitance of IO pins are around 5-15pF, and 40-50kOhm * few_tens_of_pF = around 1us rise time. The I2C specification prescribes 1us as max rise time for both SCL and SDA for the normal mode, a.k.a. 100kHz. So, it may be marginally good for the slowest speeds, with very short traces, and on a board with no significant source of noise (especially high-frequency switching (read: fast edges rather than data rate)) which could be coupled into such high impedance lines easily. That's too many problems which all could be prevented easily by two cheap resistors.

The OP asked for connecting I2C device to a Disco board. That means using external leads, and often people tend to use those terrible breadboards for interconnections, those introduce more than only a few pF of parasitics... etc.

JW

Posted on March 30, 2017 at 01:09

Oh RC time constant. I didn't think about that. thanks so much for help.