Hello,
I designed the circuit below. An older version with basically the same layout except the FT232RL, worked fine. I soldered two of these defective boards, just to be sure it wasn't a bad component or bad soldering.
(Not the best looking schematics, I know)
Click to enlargeExplaination: There is one ATmega328P, one INA219 i2c current meter and one PCA9544 i2c multiplexer. As you see I have 100nf capacitors near the ICs
The INA219 and the PCA9544 are on the same i2c bus, with pullup 3.9k resistors that I tried to replace with 2.2k and 10k without much success.
As long as I talk to the INA219 (both i2c reads and writes, address 0x45), it works fine. When I start writing to the PCA (address 0x77) it hangs.
With hangs I mean that the ATmega stops writing to the serial line too. But sometimes it works correctly for some seconds.
This behaviour can be replicated also with a simple i2c scanner.. after a while the 0x77 (the PCA) disappears from the busSo this means that even simple i2c commands don't work after a short time
This simple code (I use arduino environment) is sufficient to always replicate the problem. The same code works fine on another older board (as stated before)
Wire.beginTransmission(0x77); // address of the PCA9544A
if (channel == 0xFF){Wire.write(0x00);} //deselect all channels
else {Wire.write(controlRegister);} //set to selected channel
Wire.endTransmission();
I attached everything to my Rigol. Yellow channel SDA, Blue channel SCL
Image 1. Is this waveform ok with 3.9k pullups ?Image 2. Waveform with 2.2k pullups (unfortunatly different horizontal scale than previous image)Image 3. Proper i2c communication with INA219Now to the issues:
Image 4. A rare event when the PCA9544 works for sometime, then it starts sending 0xFF
The SCL on the right part is also narrower, and SDA doesn't reach near 0 volts .. Why ? Image 5. Usually all I get from the oscilloscope is this few bits when I turn on the board talking to 0x77. SCL left at 2VImage 6. Always the same code. Here SCL was up, while SDA was left at about 1V Image 7. Is that noise or what on SCL ? Can someone shed some light on this ? Feel free to ask for any other detail
Thank you,
Robse