cancel
Showing results for 
Search instead for 
Did you mean: 

I2C CLOCK CHOOSE SYSCLK AND PCLK1

Kishan Joshi
Associate III

HEY I am having stm32f767zi. As datasheet has mentioned it has 216MHZ CLOCK. NOW PCLK1 is 54Mhz max. So stm32cubemx has 3 option for i2c. SYSCLK , HCLK AND PCLK1. By default stm32cubemx selected pclk1 for i2c which is 54mhz. so can i use sysclk for i2c which is 216mhz?

Please help needed ! I can provide more details if you need. or redirect me to some docs which provide for clock related to i2c

7 REPLIES 7
Kishan Joshi
Associate III

Is it fine if i use SYSCLK (216Mhz) Source clock for i2c ?. What are key differences over different clock sources of i2c. I have already gone through 1000 page refrence manual Please help

KnarfB
Principal III

I don't see an issue if you change the clock. If you change it in STM32CubeMX you can see the calculated timing value as well.

I2C is usually a quite slow peripheral interface operating at fixed clock frequencies and there is no need for very high clock freq.

TDK
Guru

The I2C peripheral allows you to choose different clock sources for flexibility. You can use any clock source that meets the "I2C clock requirements" section in the reference manual. Both 54 MHz and 216 MHz satisfy the requirements.

If you feel a post has answered your question, please click "Accept as Solution".
Kishan Joshi
Associate III

ok i understand but since no body is using i have searched a lot on github looking firmwares which uses the same stm32f7 chips i2c configuration. it seems that on one uses full capacity of i2c . All of them uses pclk1 as the i2c source clock instead of the sysclk1 which is more faster and it can save a lot more time to do extra work.

that's why i got confused since stm32f7 provides the flexibility to use sysclk as source clock why don't every body use it . There might be some catch to use sysclk as the source for i2c. power is not an issue since i am not worrying about power consumption.

yes i can calculate the i2c timing the question is about sysclk vs pclk thank you bdw

TDK
Guru

The reason nobody uses SYSCLK for I2C is because I2C is limited in speed by the nature of the protocol. On the F7, the max I2C speed supported is 1 MHz. Using a 216MHz clock doesn't mean it can go any faster than using a 54 MHz clock.

If you feel a post has answered your question, please click "Accept as Solution".
Kishan Joshi
Associate III

Yes, i understand that it doesn't go faster . But when i put micros in between before reading and after reading. The difference is significant. In 54Mhz at 800Khz i2c clock i was able to read mpu6050 in 100us. And then when i changed source to sysclk and update Timing through stm32cubeide. I was able to read mpu6050 reading in 30us. That's why i wonder what happened and why every body doesn't use it sysclk as source.