I2C Reliability -

RichardP
Posts: 5
Joined: Mon Aug 06, 2018 7:19 am

I2C Reliability -

Postby RichardP » Mon Aug 06, 2018 7:56 am

Hi all,

Using a ESP32 connected to two devices on I2C I get very erratic behaviour. I have a PCF IO expander and a SI570 Controllable oscillator.

I have the I2C lines on IO 22+23 and a 330ohm pullup resistors. On first power-up, it seems to work, but then things go bad.
I2Ctext_nack.png
I2Ctext_nack.png (55.63 KiB) Viewed 5279 times
Attached is from a Logic analyser.


The transaction to the IO expander works 99% of the time, but that is simple.
I2Ctext_good_expander.png
I2Ctext_good_expander.png (6.09 KiB) Viewed 5279 times

First power-up on the SI570 Oscillator, although I do have to re-try transactions once. (there is one NACK instead of ALL nack)


In the bad cases, I get NACK and then I try 10 times to write to the address. The Bus recovers after a while and I have no idea why.
I2Ctext_bad_si570.png
I2Ctext_bad_si570.png (5.67 KiB) Viewed 5296 times
Last edited by RichardP on Tue Aug 07, 2018 8:37 am, edited 1 time in total.

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: I2C Reliability -

Postby ESP_Sprite » Tue Aug 07, 2018 3:55 am

Not sure if your pictures work... but 330 ohm seems awfully low for pullup resistors. Maybe try making these a bit higher to, say, 2K2 or 1K or so?

RichardP
Posts: 5
Joined: Mon Aug 06, 2018 7:19 am

Re: I2C Reliability -

Postby RichardP » Tue Aug 07, 2018 8:34 am

Hmm.. pictures went funny... The pullup is a 3k3 (it was a typo) - but its not the ESP32. I have got down to the Si570 not working properly if the CLK+ line is not terminated. (I left it floating, I added a load to the CLK+ line and it seems to be better)

Regards,
Richard

ESP_Sprite
Posts: 9746
Joined: Thu Nov 26, 2015 4:08 am

Re: I2C Reliability -

Postby ESP_Sprite » Tue Aug 07, 2018 1:14 pm

Check, glad to hear you solved it!

RichardP
Posts: 5
Joined: Mon Aug 06, 2018 7:19 am

Re: I2C Reliability -

Postby RichardP » Wed Aug 22, 2018 5:44 pm

Unfortunately not... I thought it was working... It ran for hours until I powered off for the night. The next day the problems were back.

I put the I2C bus on a scope and I can see glitches on the bus.. they are always there, just some slave devices are more sensitive than others. I have cloned the latest ESP-IDF code but yet to try (I am away and will only be back at the weekend)

In the meantime I have added a bitbanged software I2C driver to my project to see if things change.

Best Regards,
Richard

Who is online

Users browsing this forum: No registered users and 69 guests