Command and Control - via Morse Code?

mrburnette

Senior Member
Update: POC code posted Proof-Of-Concept

Today, I am using my blog entirely as a blog should be used... just tossing out ideas and letting my mind be a bit "free" with regard to reality. Refreshing.

In an earlier post today regarding use of audio tones detected/decoded by a PICAXE to provide some rudimentary robotic control, I responded that I thought perhaps Morse Code could be utilized as an underlying transport protocol for command and control applications. Specifically:
...
the concept of spacial-centric timing would be useful such that invalid or incorrectly received commands can be 'tossed' if they do not complete in an appropriate time frame. The creation of an "execute" command would be useful such than any valid command that is decoded must be followed by an 'execute' or the command will be purged upon the next tone input that is not execute. My own experiments with PICAXE and Morse Code suggest that a very robust system can be built around tone and timing - especially true of physical link from the audio to the PICAXE. Given the success that I and others have had, I can envision using Morse Code as the fundamental protocol and build a higher-level command structure around multiple characters. Such an implementation would have virtually unlimited capabilities since the underpinnings of command / data / execute can be easily constructed from simple primitives built as PICAXE BASIC subroutines.
As I have implemented 100% accurate hard-wired Morse Code demodulation/decoding in an 08M2+ @10WPM and in excess of 28WPM for the 20X2 running at 64MHz, audio frequency (keyed-carrier) appears to be viable for some PICAXE uses where DTMF and/or ASCII may traditionally be the first choice. Such an implementation eliminates the need for any external audio phase-locked devices such as a 567. Audio coupling is RC and an NPN transistor is used to clip the signal for PICAXE consumption.

Essentially, Morse Code as implemented in the Magic Morse Algorithm described in these forums, should allow for a lightweight command and control, roll-your-own, system. With the rather large alphabet of characters and digits, implementations could be simple to complex. For example, if I were to wish to turn on one of several LEDs connected to B.0 - B.7 of a 20X2, I could easily create a few commands such as:
[B0, B1, B2, B3, B4, B5, B6, B7] with one additional digit {0 | 1} for LED state

The software logic would loop until a "B" is received and would inner-loop until a 0-7 was received and would inner-loop again for the 0/1. Inner loops would be exited and all states cleared if the anticipated instruction or command was undefined; for example, if an 8 or 9 were received during the first inner-loop which represents our port number. Same is true if anything but a 0 or 1 is received in the second inner-loop.

The approach is somewhat brute-force, but should be robust for many needs. Since sending Morse Code with Magic Morse numbers is very lightweight, the controlled chip could even handshake via Morse Code by using one of the output pins to control a digital signal of the appropriate frequency. In fact, with proper coupling, the receive/handshake signals could be different frequencies and "ride" the same audio line.

- Ray
 
Top