cancel
Showing results for 
Search instead for 
Did you mean: 

I2C timing setup for STM32L552MEYxP

VThan.2
Associate III

Hello all,

  I have a STM32L552MEY6P. I am using it as a slave and setting an address. Using the MX cube set the speed for 400kHz.

0693W00000LzWINQA3.pngI have a Rasberry pi trying to do an address detect. Whenever I turn on the clock stretch, I get a read at address 0x50. Otherwise when the pi sends out 0x50, the data pin goes low on the ack bit and remains there.

0693W00000LzWIXQA3.pngThe pi is set to 40kHz. It seems to be a timing issue. Any thougts?

1 REPLY 1
Simon V.
ST Employee

Hello,

In I2C, when the master is reading 1 or x data, it is forcing the ack bit to low to inform slave device that it is the last data reading.

You can refer to I2C specification: 3.1.17 Device ID :The controller ends the reading sequence by NACKing the last byte, thus resetting the target device state machine and allowing the controller to send the STOP condition.

Feel free if you need more help.

Regards,

Simon

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.