2014-05-15 06:46 AM
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.2014-05-15 07:15 AM
You simply can't use I2C without pullups (unless the connected sensor board provides the pullups).
Install the pullups. JW2014-05-15 07:25 AM
Ok. I was hoping there was a way to do an internal pull up with the AF_OD setting on the GPIO.
Thanks.2014-05-15 07:59 AM
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. JW2014-05-15 10:14 AM
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