0

My Problem seems to be that my I²C slave randomly disconnects. I have an Arduino Due communicating with a Arduino Chestnut board (bought hardware). I now measure data with the Due and then send the data via an I²C interface to the Chestnut. No other devices are on the I²C bus.

The problem is that I randomly receive the error code "2" from the endTransmission method which seems to imply that the slave device disapeared from the bus. The connection sometimes works fine, and then sometimes right after startup or some time later this error occurs. I measured the signals with an oscilloscope and the clock signal then is always low.

Has someone an Idea what could be the problem?

  • lack of, or incorrect, pullup resistors? – Jaromanda X Feb 27 at 10:03
  • Standard Arduino pullups, 4k7 – Robert Reichel Feb 27 at 11:02
  • 1
    The Arduino Due has sometimes troubles with the i2c bus. Lately I see more people having problems with the Due and the i2c bus. The Due has onboard pullup resistors of 1k5 (sometimes 1k), that is very low. Some add 100 ohm resistors in the signal path of sda and scl to reduce the slew rate. Can you replace the Due with a samd21 (zero, m0, mkr boards)? Add a delay of 1ms between Wire.endTransmission and Wire.requestFrom. Show us the sketch of the master and the slave please. The slave is not allowed to turn off interrupts. How long are the wires? Do you use a cable? Are the GND connected? – Jot Feb 27 at 13:32
  • I can't switch boards, I got the circuit, hardware and the code from my supervisor with the task to fix the i2c problem. But I will tell him about the problems of the Due with the i2c interface and how to fix it and the we'll see what I am allowed to do. – Robert Reichel Mar 4 at 6:28
  • The master (Due) just sends data to the slave (actuator) because my actuator is hardwired to be a slave device. The GND are connected (same power source) and the cable is a standart, shielded three wire cable (just SDA and SCL used, one is connected to GND). What do you mean the slave is not allowed to turn off interrupts? I use a simple protocoll, master sends data, slave waits to receive data (gets interrupt when data is reveiced) and then moves some motors according to the data. I guess the slave can only turn off interrupts because of a library error, but how can I check this? – Robert Reichel Mar 4 at 6:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.