I am attempting a prototype robotics project (A moving arm with grippers to begin with).
I have to say a big thank you to Gert as his manual for the gertboard has allowed me to easily write code on to the ATMega which will handle servo control, along with analog inputs.
I am however a little confused as to how communication in general occurs between the RPi and the ATMega chip - as I would like eventually for a Java 'control' program to tell the ATMega which hardware operations to carry out.
I have considered using 5 of the digital inputs to the ATMega and treating them as a 5bit input to an ATMega program which would constantly loop and detect a change in their result. This seems like it could easily go wrong however, as the RPi could not be guaranteed to write the individual bits quick enough to prevent a mis-read. It also leaves me with only 32 options to carry out, and few spare pins to deal with sending readings from analog sensors (Such as a temperature sensor) back to the pi.
Am I missing an obvious bi-directional communication mechanism between these two?
If there is such a mechanism please bear in mind my electronics knowledge is relatively basic, so if anyone knows of a blog/tutorial where someone had use this mechanism and I could read about it in a step by step fashion that would be fantastic.