I2C repeated start condition to read BME280 problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-01-01 1:18 PM
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:
- Generate Start condition
- Check for SB flag
- Write Dev_Address + 0 (WR)
- Check for Addr flag
- Clear Addr flag
- Write (first) Data_Register_address (0xF7)
- Generate Start condition
- Check for SB flag
- Write Dev_Address + 1 (RE)
- Check for Addr flag
- Clear Addr flag
- Reading 8 bytes data (From 0xF7 to 0xFE)
- NACK
- Generate stop condition
It works fine for the first try of reading. SCL and SCK as following:
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:
I think, in the second time, repeated start condition is not performed well.
Labels:
- Labels:
-
I2C
-
STM32F1 Series
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
