2017-07-13 09:27 PM
I'm trying to get a 100 or 400 kHz rate on I2C3 SCL to interface with a Sparkfun IMU breakout board. I was wondering what value I should set 'TIMING' to in order to achieve this rate with an STM32L476RG Nucleo board. For reference, this is the 'TIMING' value I'm trying to calculate:
hi2c3.Instance = I2C3; hi2c3.Init.Timing = 0x0020098E; // Thought this was 100 kHz based on other examples, but appearing as 600 Hz on my oscilloscope2017-07-14 03:56 AM
Hi
t2balach
,Please try to refer to
I2C timings paragraph and
Timing register (I2C_TIMINGR)
in your related reference manual.-Nesrine-
2017-07-17 05:34 AM
Note, that unless clock stretching is disabled, the actual run-time timing is dependent also on the clock rise time, which may be longer then what's set up in the register if there is significant capacitive load and on the bus and the pullups' resistances are high. Slaves may also stretch clock, influencing the resulting timing.
JW