I2C Read returns incorrect data while Physical Bus has correct Data.
Posted: Tue Feb 06, 2024 9:35 pm
I am experiencing a situation very similar to
https://esp32.com/viewtopic.php?t=35508
https://esp32.com/viewtopic.php?t=30427
I am reading data from a DPS310 sensor. I read from it every 1 second.
On average the device runs for 2+ to 3+ hours and then I get an Assert thrown because the value read from the DPS310 does not match what it should be.
I have probed the I2C bus with a MSO scope and I can see the I2C data decoded and it is exactly what I expect, yet the value returned from the I2C read function is wrong.
Physically everything looks good.
I'm running at 100khz using 4k7 resistors.
The I2C SDA/SCL pulses have pretty good edges.
The two issue I have linked to had the same solution in opposite directions. Both changed the clock speed but one from 10k to 100k and the other from 100k to 10k.
I wanted to see if there has been anymore light shed on this issue and what is causing it. Because Physically I can't understand why the I2C peripheral would be clocking wrong data in while everything physically looks perfect on the bus.
https://esp32.com/viewtopic.php?t=35508
https://esp32.com/viewtopic.php?t=30427
I am reading data from a DPS310 sensor. I read from it every 1 second.
On average the device runs for 2+ to 3+ hours and then I get an Assert thrown because the value read from the DPS310 does not match what it should be.
I have probed the I2C bus with a MSO scope and I can see the I2C data decoded and it is exactly what I expect, yet the value returned from the I2C read function is wrong.
Physically everything looks good.
I'm running at 100khz using 4k7 resistors.
The I2C SDA/SCL pulses have pretty good edges.
The two issue I have linked to had the same solution in opposite directions. Both changed the clock speed but one from 10k to 100k and the other from 100k to 10k.
I wanted to see if there has been anymore light shed on this issue and what is causing it. Because Physically I can't understand why the I2C peripheral would be clocking wrong data in while everything physically looks perfect on the bus.