cancel
Showing results for 
Search instead for 
Did you mean: 

Unclean I2C - STM32WL5MOCH

biobuilder
Associate III

The I2C on our board is unclean, at all clock speeds - 1 MHz, 400 kHz and 100 kHz - even without rf circuitry running.  Signal traces are about 5 cm long in total.  Pullups were set at 1 kOhm to enable Fast Mode Plus, but even the Standard 100 kHz low frequency signal is glitchy. 

All the modules work most of the time, but eventually they glitch out and quit.  This probably has something to do with the I2C signals.  

All of these chips are supposed to be able to handle a 1 kOhm pullup to 3.3V.  They are also supposed to be able to handle up to a 1 MHz I2C clock.

 

Here is my schematic.  SDA and SCL are connected to I2C2 on the STM32WL5MOCH.  

Captures1.PNGCaptures2.PNGCaptures.PNG

To test the individual performance of each device, we individually enabled / disabled each module and then watched the I2C signal at 100 kHz.  

 

Communicating with the OLED:

The MCU generates weird little spikes every once in a while, almost like it can't decide whether or not to hold that line down.

Capture.PNG

SHT40I-AD1B-R3 Temperature Sensor

Capture1.PNG

VL53L4CDV0DH/1 Ranging Device:

Capture4.PNG

What is that ugly signal?  How do we get rid of it?

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Super User

OLED trace is normal. Spikes occur during tradeoff on SDA line for ACK bit.

other traces not so much. Measure before and after the series resistor to see what’s trying to drive. Are pins set as open drain?

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Super User

OLED trace is normal. Spikes occur during tradeoff on SDA line for ACK bit.

other traces not so much. Measure before and after the series resistor to see what’s trying to drive. Are pins set as open drain?

If you feel a post has answered your question, please click "Accept as Solution".
biobuilder
Associate III

We discovered the primary issue - when the OLED is powered off, it interferes significantly with the I2C lines.  However, when it is powered on, the I2C lines are significantly cleaner.  Perhaps the OLED is trying to power on when the I2C lines are pulled low due to vampire current.  We're not sure why this is the case, but it easy enough to fix programmatically.  

 

The next question we have is: why are there random spurs right after specific clock edges - and how do you get rid of them?  It almost looks like the drive transistor is coupling to that clock edge, or there is a tiny glitch in the hardware peripheral.  The spurs always occur at specific locations, even at different I2C frequencies - from 100 kHz to 1 MHz.  The spurs are present even if the OLED is completely removed from the circuit.  We have tested on two different boards, and the issue is exactly the same.  We have tested with different pullup resistor values, both 1 kOhm and 3.3 kOhm.  This has got to be some kind of hardware / software glitch.  

Capture12.PNG

1 MHz I2C Signal, 1 kOhm Pullups

Capture13.PNG

400 kHz I2C Signal, 1 kOhm Pullups

Seems like the spurs are slightly worse if the pullup resistor value is lower.  We tested with 3.3 kOhm as well as 1 kOhm.  The 3.3 kOhm resistor was unable to go above 400 kHz without significant signal degradation.  The 1 kOhm resistor worked at 1 MHz, however, the tops were rounded off.  

Thanks, I just needed clarification about the SDA spikes.  You're saying the spikes are normal during tradeoff.  That's all I needed to know - I guess as long as that spike doesn't interfere with the data.  Is there any way to get rid of them altogether?

They are not causing issues and there's no need to get rid of them. Look at random I2C traces online and you'll see them everywhere. They are a non-issue.

Here is one such random scope trace showing a spike at the ACK bit:

TDK_0-1748610980868.png

 

If you feel a post has answered your question, please click "Accept as Solution".