cancel
Showing results for 
Search instead for 
Did you mean: 

I2C repeated start condition to read BME280 problem

IDavo.1
Associate II

Hi,

Device: STM32F103C8T6

Driver: LL (low layer)

It's been days I have struggle reading BME280 which is connected with i2c to my mcu. After configuration, I'm trying to read registers with standard reading procedure as following:

  1. Generate Start condition
  2. Check for SB flag
  3. Write Dev_Address + 0 (WR)
  4. Check for Addr flag
  5. Clear Addr flag
  6. Write (first) Data_Register_address (0xF7)
  7. Generate Start condition
  8. Check for SB flag
  9. Write Dev_Address + 1 (RE)
  10. Check for Addr flag
  11. Clear Addr flag
  12. Reading 8 bytes data (From 0xF7 to 0xFE)
  13. NACK
  14. Generate stop condition

It works fine for the first try of reading. SCL and SCK as following:

0693W000006HJUXQA4.bmp 

But when I do the same procedure after 5sec (for the second time), right after repeated start condition, both SDA and SCK go to low. As following:

0693W000006HJUmQAO.bmp 

I think, in the second time, repeated start condition is not performed well.

0 REPLIES 0