Greetings all,
I apologize if this topic has been covered, however I have searched HIGH and LOW and have not been able to find a clear answer to my conundrum. I am wondering what is the best comm protocol (I2C, SPI, CAN) to send data, between two Arduinos, within a compare match interrupt?
My application is this:
I would like to have one Arduino, call it Arduino1 performing a calculation, the output of that calculation will then be sent to a second Arduino, call it Arduino2, which will use the value to perform a second calculation. Arduino1 needs to send data to Arduino2 at a rate of 50 Hz, so I have set up a compare match interrupt on Arduino1 to send data at 50 Hz.
I have tried using I2C within the interrupt service routine (ISR) however that does not seem to be working. On some blog post a blogger hinted that I2C uses interrupts and wouldn't work within an ISR because interrupts are disabled within an ISR. Any thoughts?
Thanks
Thanks