AnsweredAssumed Answered

STM32L1 I2C in Fast Mode

Question asked by Zoher Ghadyali on Jun 15, 2017
Latest reply on Jun 16, 2017 by Zoher Ghadyali

I am using the stm32l1xx_i2c.c code and I am successfully using I2C to interface with a BNO055 IMU. Everything is working perfectly at 100 kHz and now I want to speed that up as much as I can. My PCLK1 frequency is 32 MHz (which I realize is not a multiple of 10 MHz) so I can't reach 400 kHz but I want to get as close to that as possible.

 

Now, in my I2C_InitStructure, I have set the clock speed to 400000 (400 kHz). I have enabled clock stretching and set the fast mode duty cycle after enabling I2C using:

 

I2C_StretchClockCmd(I2C2, ENABLE);
I2C_FastModeDutyCycleConfig(I2C2, I2C_DutyCycle_2);

 

I must clearly be missing something because I am still only measuring 100 kHz on my SCL line.

 

I apologize if the answer to this question is obvious. I am very new at working with STM32 microcontrollers and I2C.

 

Thanks!

Outcomes