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.
I2C Read returns incorrect data while Physical Bus has correct Data.
-
- Posts: 20
- Joined: Wed Nov 10, 2021 7:13 pm
-
- Posts: 20
- Joined: Wed Nov 10, 2021 7:13 pm
Re: I2C Read returns incorrect data while Physical Bus has correct Data.
I have tried lowering the i2c clock to 50khz and 25khz and still getting incorrect values returned from the i2c. On the physical Bus the data is correct.
-
- Posts: 1725
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: I2C Read returns incorrect data while Physical Bus has correct Data.
Then the problem is likely in your code...On the physical Bus the data is correct.
Re: I2C Read returns incorrect data while Physical Bus has correct Data.
I think some details would help.
What ESP32 processor are you using?
What version of ESP-IDF are you using?
What are your I2C port assignments?
Can you show your code that configures the I2C?
Can you show your code that reads the I2C?
What ESP32 processor are you using?
What version of ESP-IDF are you using?
What are your I2C port assignments?
Can you show your code that configures the I2C?
Can you show your code that reads the I2C?
Who is online
Users browsing this forum: Gaston1980, Majestic-12 [Bot] and 413 guests