Firstly, I stripped out unneeded code, some 90%, from the Arduino Mk I project, to create an I/O controller which just collects transactions from the VFOs, encoders and switches, then sends them on a serial port. I already had most of that code, so it didn't take long to get it working. Here's the serial I/O protocol I've ended up with:
At the top is the four commands that the Arduino sends to its host. These are sent every 20ms if there has been a change. Why 20ms? The Flex radio is not happy with updates much more often than once every 20ms, so there is no point collecting data from the controls any more frequently than that.
The protocol is deliberately designed to be as light as possible. The issue here is that we want the absolute minimum time between a control being changed and the effect of that change being processed by the radio. The Mk II design has added another series element in the chain and that must be made as fast as possible. This is how, say, a VFO frequency change progresses to the radio:
Control input > Arduino processing > Command serialisation > Host processing > Network transport > Radio processing.
At 115,200 baud, say 10,000 characters per second, the serialisation delay of a VFO change command, which is 8 characters in length is about 0.8ms, which is perfectly fast enough.
You'll also see a small set of codes that are sent to the Arduino. These are needed to set the LEDs and static tune rates for the VFOs. There's also a restart function, that is called when the host starts up to ensure that the I/O controller is in a known state.
I also defined the physical pin out from the Arduino to the various panel controls and indicators:
This pin out has the advantage that all pins are available along one edge of the Arduino, making it much easier to connect up to the physical controls, whether the controls are mounted on a PCB or are individually wired. I'll write more about this aspect of the design very soon.