cancel
Showing results for 
Search instead for 
Did you mean: 

I2C_frequency configuration

SDhar.1
Associate II

Hi,

I would like to configure the I2C frequency based on the input clock frequency. Is there a specific formula to calculate the I2C timing values? Also, I would like to know whether this formula is applicable to all STM32 microcontrollers, or if it varies depending on the MCU series.

Could you please provide clarification on this, along with example code for configuring the I2C frequency using the appropriate register settings and formulas?

Thanks,
Sainath 

2 REPLIES 2
KnarfB
Super User

The official source is the I2C chapter in the reference manual of your MCU. It comes with tables for some common  settings, otherwise you have to go through the text and formulae.

You may find it easier using STM32CubeMX to derive the register values for your setup.

hth

KnarfB  

Pavel A.
Super User

This request pops out here every so often. It's the time for a KB article?