Frank CA

STM32 I2C peripheral - bus loading

Discussion created by Frank CA on Mar 23, 2018
Latest reply on Mar 26, 2018 by Frank CA

I have this interesting situation that the I2C1 peripheral on an STM32F103C8 does not produce any output on SCL or SDA. On this chip, if I reprogram the pins as GPIO, they work fine.

 

I am using Blue Pill boards, Atollic TrueStudio, HAL drivers plus a clone logic analyzer.

 

It seems that the I2C1 peripheral is somehow misconfigured or the pin drivers for these two pins (B6, B7) are at fault.

 

Update:  So the real cause has been revealed - it is bus loading. Turns out the combination/number of devices I have on the I2C bus plus the logic analyzer probe killed the SCL line - the SDA line was unaffected. Being a cheap (and nasty as it turns out) logic analyzer its probe characteristics are not as high impedance or low capacitance as you would find in better devices. The port pin only exhibits this sensitivity in open-drain mode as configured for I2C bus, not in push-pull mode which has a greater drive capability as used for GPIO setting. My temporary solution to get the prototype board running is to buffer the SCL line - to be fixed later.

Update 2: see comments below for further information. Also my ongoing probing has revealed possible issues due to chip errata.

Outcomes