2024-03-07 01:31 PM
So, I was having lots of trouble getting an I2C discrete I/O expander chip working with the STM32H745 Disco board, and discovered, besides needing to shift the I2C address left by one bit, that the I2C clock goes faster the more you increase any of the dividers in the chain to the I2C peripheral when using STMCubeMX to set up the I2C clock.
That is, the baud rate on the I2C SCLK line, as seen by an oscilloscope, decreases with all three clock dividers:
D3PPRE,
HPRE Prescaler, and
D1CPRE prescaler,
all with I2C custom timing disabled and in standard speed mode, 1KHz frequency requested (couldn't make that work at all), 100ns/300ns rise/fall times, analog filter enabled, digital filter coefficient 0, and no slave features enabled.
This is autogenerated code from STMCubeMX 6.9.2 and compiled with optimization turned off on IAR Embedded Workbench for ARM 9.5. I've added calls to read and write to an I2C memory only, and turned off a bunch of peripherals I'm not using on the discovery board.
2024-03-08 08:36 AM
Hi All,
This case has been routed to our online support center for direct support.
Regards,
Jake
ST Support