cancel
Showing results for 
Search instead for 
Did you mean: 

I2C1 stops working over 8MHz STM32F042F6P6

Davaol19
Associate III

Hello all,

I'm having problems with I2C1, i have a code that works perfectly while i configure the HCLK to 8MHz but it stops working when i set any higher frequency. Has anybody faced similar problem?

I am using STM32CubeIDE for setting the project, this microcontroller has a separate clock from HCLK, and i can't understand why I'm having this problem.

 

Thanks in advance.

20 REPLIES 20

Hello again,

i've been debugging and i found that when i increase the frequency and the comunication stops, in te Master i have the TXE and BUSY flags, but in the Slave i have set the TXE, BUSY and ADDR.

Master keeps looking for the TXIS but nothing happens. 

Any recomendations about that?

 

Also i want to ask about the I2C clock diagram, because i see that the source clock for the I2C is not the same as for the registers, maybe i'm forgetting something needed to match between I2C and registers while modifying de frequency?

 

Davaol19_0-1707307242963.png

 

This block diagram is from de STM32F042F6P6 reference manual

 

thanks!