cancel
Showing results for 
Search instead for 
Did you mean: 

Config i2c with no external pullups

saccrue
Associate II
Posted on May 15, 2014 at 15:46

I'm trying to connect my STM32F100 Discovery board to a sensor using the I2C bus. The sensor resides on a breakout board and I am using clip leads to go from my Discovery board to the breakout board. How would I configure the I2C on the Discovery when I don't have any external pullups in place?

Thx.

KS.
4 REPLIES 4
Posted on May 15, 2014 at 16:15

You simply can't use I2C without pullups (unless the connected sensor board provides the pullups).

Install the pullups.

JW

saccrue
Associate II
Posted on May 15, 2014 at 16:25

Ok. I was hoping there was a way to do an internal pull up with the AF_OD setting on the GPIO.

Thanks.

Posted on May 15, 2014 at 16:59

I honestly don't know.

The GPIO documentation is, to put it mildly, a mess. In the 'F2/'F4, the pullup/pulldown setting is independent of the in/out/alternative setting, thus can be set to alternative+pullup; the user manual of 'F1/'F100 indicates it is not possible in these families - I have learned not to take too literally everything the ST manuals say, but I have no first hand experience with these.

But even if you could (as in 'F2/'F4), the internal pullups are rather weak,  equivalent of typ. 40kOhm, leading to potentially long setup times, necessitating slow I2C communication, and careful checking with an oscilloscope.

Bird-nesting two resistors onto the DISCOVERY shouldn't be so difficult, though.

JW

saccrue
Associate II
Posted on May 15, 2014 at 19:14

Yeah, I saw that in the F4 docs. I went ahead and hacked 2 resistors in there, no big deal, so it works now for my initial coding and testing.

Thanks.

KS