cancel
Showing results for 
Search instead for 
Did you mean: 

I2C Timing Calculation for STM32H7

MFawzy
Associate II

I want to know how to calculate the Timing register content on my own for the I2C clock speed, I know that it can be generated by the STMCubeMX.

3 REPLIES 3
Imen.D
ST Employee

Hello @MFawzy​ ,

I advise you to refer to this article that will help you on the I2C Timing configuration.

Hope this helps you !

Please mark my answer as best by clicking on the "Select as Best" button if it helped :)

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

thank you very much for your fast reply @Imen DAHMEN​ 

but it seems that I wasn't clear in my question because I already read the advised article but I want to know if there is anywhere a code that can do the Job.

I found the excel sheet in STSW-STM32126 - I2C timing configuration tool for STM32F3xx and STM32F0xx microcontrollers (AN4235) - STMicroelectronics but the code can't be seen.

I think that to calculate the timing is a try and error process and i didn't want to invent the wheel is there is already an implemented simple algorithm that can calculate the timing register with minimum amount of error.

Mohammed

Imen.D
ST Employee

Hi @MFawzy​,

Sorry for the delayed reply on this, but I must admit I've found it difficult to find something to say to you, as the excel sheet is an old tool today (and the person who maintain this tool was not in ST today).

In fact, there is an utility development some few years ago from CubeMX calculation formula. (please see files in attachment).

This utility is now added on example path, as example on new product STM32U5 (\Firmware\Projects\NUCLEO-U575ZI-Q\Examples\I2C\I2C_TwoBoards_ComPolling).

Hope this helps you!

I don’t know your real need for your interrogation, but feel free to come back if it is not sufficient for you.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen