Skip to main content
JBond.1
Senior
December 20, 2020
Question

"STM32" vs "STM32 Arduino" - I2C difference

  • December 20, 2020
  • 3 replies
  • 2562 views

Hi, I am trying to debug my code with logic analyzer and see why my code works on "STM32 Arduino", but does not work on "STM32".

Viewing at logic analyzer I see that "STM32 Arduino" much more consistent.

0693W000006GOctQAG.pngWhy could the message be different "0xD1 0x00" vs "0xE8 0x00"? Is it just logic analyzers bad measurement or does the sensor gets the same and behaves differently?

Any ways I could fix this difference?

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
December 20, 2020

Aren't these two entirely different types of transactions? Top one reads 0x00, bottom writes 0xE8,0x00

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
JBond.1
JBond.1Author
Senior
December 20, 2020

100% same transactions.

Its some kind of SCL issue? Or could it be just logic analyzer bad measurement?

Also on "STM32 Arduino" I was able to measure at 100MHz and transactions remain consistent. On "STM32" measuring at 100MHz gets even more "distortions", so I try to measure at ~400KHz which is 500KHz to get better results.

Tesla DeLorean
Guru
December 20, 2020

You might want them to be, but they clearly aren't.

It is not a signalling issue,the protocol looks fine, you're calling the wrong library functions, or your code for the register read/write to your specific I2C slave decomposes that incorrectly.

You'd need to present the code that you're trying to implement, and cite the part.

Evidently staring at the LA plots isn't pointing you in the right direction.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
December 20, 2020

Also on "STM32 Arduino" I was able to measure at 100MHz and transactions remain consistent. On "STM32" measuring at 100MHz gets even more "distortions", so I try to measure at ~400KHz which is 500KHz to get better results.

You should measure at a rate significantly higher than the clock frequency. Not sure 400 kHz is going to cut it.

If measuring at 100 MHz shows the result is not as expected, fix the code, not the logic analyzer.

Probably a bug in the code.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JBond.1
JBond.1Author
Senior
December 20, 2020

I think wires were to blame. I have shorten the wires a bit and now I get exectly the same even on 100MHz. Thanks!