Well, I'll give you a little info on what I have..
I have 1 Mega 2560 doing engine controls, which of course involves reading lots of sensors, and turning outputs on and off.
It will have various tuning parameters, Some boolean, some integer, some byte, some floating point, and some integers in 2 dimensional arrays.
I have a 2nd Mega with a Sainsmart 3.2" TFT touchscreen I would like to display the parameters on, and be able to update the tuning parameters on the controller Arduino.
First off, How should I electrically connect them? I'd like to keep as many interrupt accessible pins on both units as I can... Apparently SPI doesn't support slave mode, so that's out..
How about just using pins 0 and 1.. I know they'd be shared with the USB controller, but would it be a problem? CAN bus would be an option (controller unit already has it) if the Touchscreen shield didn't kinda hog all the accessibility of the ports, but would require additional hardware. The two units will be about 6 feet away from each other, if that's important.
Secondly, What kind of data transfer method should I use that requires minimal parsing on the other end and doesn't require large amounts of bandwidth
So far I'm thinking I'm going to have to make a message with roughly the following structure
Message length in bytes (1 byte) with 1 reserved bit (to request the value rather than update it)
Message type (array, boolean, integer, string, etc) (1 byte)
Address (which variable we're modifying)(2 bytes?)
Data (could be up to about 250 bytes, but in practice will probably only be about 4 bytes)
For the Data, I think I'd limit floating point numbers to 10 bits for the base, 1 sign bit, 4 bits for an exponent, and the 16th bit would be the sign of the exponent..
It would give me 4 significant figures from 1e-15 to 1023e15 both positive and negative.. It should work
I'd really like to hear any criticism on this so I can avoid pitfalls before I spend massive amounts of time designing it!