Hi everybody,
as the title of this topic says, I'm having problems with my Due using I2C. More precisely I'm having random (several times a day or none at all) the situation were the data line of my I2C communication is stuck low. I assume that the communication cycle is somehow disturbed and one of the slaves is holding the bus low.
The Due is configured as master and is connected to several slaves, PWM chips, temperature sensors, EEPROM. The clock speed is set to 75kHz. Attached you can find a picture from the logic analyser capturing the moment of the bus lock up and an oscilloscope picture showing the signal quality. Please be aware, that the different clock pulse length on the logic analyser picture came from the low sampling rate of 200kHz. It was necessary to set it that low so I can capture a longer period of time. With a higher sampling rate the clock is perfectly fine.
Although the root of this problem might be hardware I ask you to discuss software based solutions here. The hardware is pretty big and is hard to explain in this topic. And that being said I work full time on investigation hardware related problems but couldn't find any obvious problems yet.
That's why I ask you if someone has an idea to tackle this problem from the software side. I was carefully reading the NXP (Phillips) document for the I2C bus specification and in section 3.1.16 Bus Clear you can find the paragraph:
"If the data line (SDA) is stuck LOW, the master should send nine clock pulses. The device
that held the bus LOW should release it sometime within those nine clocks. If not, then
use the HW reset or cycle power to clear the bus."
Unfortunately I can not make a HW reset nor can I make a power cycle cause everything is combined in a moving system and would be damaged/not working properly if doing that.
I was looking into the wire library of Arduino and correct me if I'm wrong but unfortunately I couldn't find any error handling that can handle a situation like this.
So my question is somebody having or already solved a similar problem or can you give me a hint in any direction. I will also try to make a minimal piece of firmware that includes only the communication with some of the I2C components. This will help test and discuss several approaches
This is