cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F3-Discovery: accessing LSM303DLHC with I2C fastmode

adam239955
Associate II
Posted on September 08, 2015 at 12:27

According to STM32F3 Reference Manual RM0316 and accelerometer/magnetometer LSM303DLHC Datasheet both these devices support I2C fast-mode at 400kHz, yet when I measure the GPIO PB6 with my oscilloscope, I only get about 82kHz.

We run the system clock from HSE (8 MHz) multiplied by 9 to 72 MHz.

When I specify to use the HSI at 8 MHz

I downloaded the stsw-stm32126 Excel sheet configuration tool to get the value for the `TIMINGR`register correct (also using Application Note AN4235), but no improvements can be detected. I use no filters and the fall/rise times are set to 300ns in the excel sheet.

If I use the HSI clock which only runs at 8 MHz, I get faster performance than with the SYSCLK.

RCC_PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI or _SYSCLK;

Is there something I have completely missed or is this not supposed to work?

#i2c #lsm303dlhc #stm32f3
0 REPLIES 0