For the past year I have been engineering my own autopilot shield for the Arduino Mega(and unintentionally the Due). I hope to be finished by the time AVC rolls around, but I have run into an issue. I currently an using 3 separate Arduinos(Mega: autopilot, ArduIMU, and Atmega328: fail safe) and I am having trouble communicating with them efficiently. Currently I have the Mega just waiting for a start data signal(at the beginning of a steam of data. Ex. "###") from the fail safe or ArduIMU, and then it decodes the data string following the start signal. But sometimes it can take upwards of 130ms per system to receive one string of data(because its waiting for the start signal. not because of excess data). 130ms for ArduIMU and 130ms for Fail safe. This isn't fast enough. The problem is that I am waiting for the two arduinos(Ex. arduIMU and mega) to be in sync but that doesn't happen very often. I have thought about using interrupts, but then I was afraid of interrupting crucial sections of the code. I have looked into MAVlink protocol because, If I understand it correctly, the heartbeat that it sends out is used for synchronization between devices?
I was hoping someone could point me in a direction that would help me synchronize communications in a way that does not involve a lot of waiting.
Thanks in advance!
If you are interested in reading more about the project, I have a blog.(Way out of Date and no pictures yet)
(Sorry for posting on the main page, I didn't see a suitable place in the forums)