cancel
Showing results for 
Search instead for 
Did you mean: 

I2C clock timing generation

antonio.portaluri
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
antonio.portaluri
Associate II

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

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

View solution in original post

2 REPLIES 2

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

JW

antonio.portaluri
Associate II

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

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