Skip to main content
antonio.portaluri
Associate II
January 3, 2019
Solved

I2C clock timing generation

  • January 3, 2019
  • 2 replies
  • 1279 views

Hi,

I've read that for some STM families (F0, F3, L0, L4, etc.) the I2C clock timing must be calculated with an excel file or with the STMCubeMX software.

The calculus is "closed source"? Can I reproduce it in my own code?

I'm writing an interface for an I2C device and I want to support multiple boards. But how can I let the user choose the I2C clock of its master device using, for example, an STM32L4 board?

The user has to download the STMCubeMX software, generate the I2C clock and then report it to my code? It is the only way?

Thanks in advance,

Antonio

This topic has been closed for replies.
Best answer by antonio.portaluri

I think this document is very useful to understand the calculus.

https://www.st.com/resource/en/application_note/dm00074956.pdf

2 replies

waclawek.jan
Super User
January 3, 2019

The I2C chapter in RM contains everything needed for calculating the values in I2C_TIMINGR, see the I2C timings subchapter.

JW

antonio.portaluri
antonio.portaluriAuthorBest answer
Associate II
January 7, 2019

I think this document is very useful to understand the calculus.

https://www.st.com/resource/en/application_note/dm00074956.pdf