2016-07-24 06:50 PM
I know that I2C's official speed is 100KHz (Standard Mode), 400KHz (Fast Mode), 1MHz (Fast Mode Plus).
But, in my lab application, I need to implement 4MHz I2C signal. I had used FPGA logics to achieve 4MHz I2C signal. But, to make simple system I'm changing it to STM32F207. But, I can't make 4MHz I2C. I'm using 0.8K Ohm Pull-Up resistor on SCL and SDA to achieve 4MHz. I generated the reference code with CubeMX. With this code, 1MHz I2C can be made very easily. Changing the initial speed setting is it. That was all. But, if I tried to change the speed to 2MHz or 4MHz, the signal is notgenerated properly. Can you make examples to generate 4MHz I2C ? MX_I2C3_Init ( ); HAL_I2C_Master_Transmit ( );I tried to change options, and to modife code in Transmit();I had put more condition checkings and delays, but it didn't make change. I can clear the HW issue if there is. So, please let me have your reference codefor 4MHz I2C. Thanks, Best Regards, Danny2016-07-25 08:25 AM
Consider using a more appropriate interface, like SPI?
Check the divisor/prescaler options in the reference manual, you probably can't get to 4 MHz, but it seems like a bad plan anyway, rethink.