1

In my design, one arduino pulls a line high on other arduino, the other arduino polls this pin and if that is high sends the data on I2C bus.

The first arduino holds the line high for 100ms using the delay() method, the other arduino is sending the data during this time, but the I2C receive interrupt is not being triggered.enter image description here

I have attached a sequence diagram for a better explanation for what is happening.

I suspect that the delay() method somehow is disabling the I2C ISR from triggering.

3
  • How have you set up I²C? Which is slave and which master? Why bother with any signalling other than I²C?
    – Milliways
    Commented Dec 6, 2014 at 9:49
  • because, my earlier design had a scenario where both the device started communicating over I2C at the same time, now the second device shall only send when the first asks it to do so.
    – ArunMKumar
    Commented Dec 6, 2014 at 11:11

1 Answer 1

2

Sorry guys, I made a very silly mistake here, i was using Serial.print here in ISR, following the Slave_Receiver example in the Arduino examples. I got a bit carried away with the use of those Serial debug messages and added lots of them,

I got this info from https://stackoverflow.com/questions/17985830/arduino-using-interrupts-freezes-processing-and-serial-output

checkout answer by elias

The code does not freeze now. Sorry for the troubles, i hope this helps someone else in return.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.