-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C spikes on master init #393
Comments
Thanks for the very clear description. I think it might be related to "no external Pullups", I will try to look into this. |
I tried to reproduce this issue with strong Pullups on SDA and SCL (1kOhm). Exactly the same behaviour. |
Add set level code in i2c_set_pin can fix the issue. Trying to merge to idf ASAP.
|
Fix I2C spikes on master init. This issue is reported from #393 Before I2C io init, set high level on SDA/SCK IOs.
I'm using a own function names "i2c_master_init()" to initialize the i2c subsystem on the ESP32. After calling this function I get pulses/spikes on SDA/SCL which some Slaves interprets as an "START". This behaviour results in errors on later real "START"'s which prevents to directly use those Slaves. A workaround is to make a dummy request to those Slaves ("START", WRITE ADDRESS", "STOP")
My hardware consists of no external Pullups. I've used the Sparkfun ESP32 Thing together with an MPU-6050. I was able to reproduce the same Issue with a HTU21D Sensor.
My function "i2c_master_init()" consists of the following startup tasks:
My sequence to make those "dummy" requests is the following:
After this "dummy" sequence I can normally talk to the slave device:
On this image you can see an overview of the spike (Trigger point) and the followed byte write's:
Here is a closeup of the spike:
This is a closeup of the "dummy" request + data write. You can clearly see that on the "dummy" request the sensor doesn't work properly (confused state machine due to the spike) and afterwords work perfectly with it's address:
The text was updated successfully, but these errors were encountered: