cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L4R5AG fast mode I2C with 4MHz PCLK

K-.2
Associate

Hi,

I'm using the STM32L4R5AG MCU with 4MHz MSI clock.

I want to use I2C in fast mode (400kHz).

The PCLK for I2C is also 4MHz from the MSI directly (in my application, I don't want to use a PLL).

In CubeMX for 4MHz PCLK, if I select fast mode, the TIMINGR calculated is 0x0004 (with analogue filter on, digital filter off).

But if I use that value, on the oscilloscope I can see that I get an I2C frequency that is lower (around 350kHz).

So I did some trial and error and a value of TIMINGR = 0x0002 (with analogue filter on, digital filter off) gives 400kHz output and the SCLK high time measured is 1µs and the low time measured is 1.5µs.

Since the high and low times are higher than the minimum values in the I2C specification for fast mode (min is 0.6µs and 1.3µs), can I use TIMINGR = 0x0002 (with analogue filter on, digital filter off) and ignore the CubeMX calculated value of 0x0004?

Is there any chance of signal integrity issues or reliability issues with my setup?

Thank you.

0 REPLIES 0