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.

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, privacy policy and cookie policy

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