Skip to content

I2C speed at 320 kHz instead of 400 kHz on the STM32F411 #14267

Discussion options

You must be logged in to vote

If you look into the data sheet and the way, the I2C hardware is set up, it's clear that 400k cannot be achieved. The I2C device clock is 24MHz. According to the data sheet, getting to 400KHz requires a multiple of 10 MHz for the I2C clock. You could get that by changing the clock configuration of the device, e.g. by setting the clock to 80Mhz or trying 100Mhz. You have to change the value of:
#define MICROPY_HW_CLK_PLLN (192)
in mpconfigboard.h to either 160 for 80Mhz clock or 200 for a 100MHz clock. The latter is out of the spec, but could work.
Note that the actual clock at the bus depends as well from the rise time of the clock signal, determined by the time constant of all R's and C'…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@robert-hh
Comment options

@robert-hh
Comment options

@robert-hh
Comment options

Answer selected by saraverbeecke
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants