Recently I was faced with the task of sending data out of a HCS08 microcontroller wirelessly. I had only one pin available to me and decided to effectively create Morse Code so that my receiver could decode the signal without having some sort of reference clock to distinguish the 1′s and 0′s. What took many hours to conceptualize and diagram out on the blackboard, turned out to be a very small bit of code.
On the sender side is a simple function written in C that takes a byte and loops through masking each bit. This masking is done inside an if / else block and the result determines whether or not you are getting a dit or a dash.
Tied to the RF receiver is another MC9S08QG8 which takes in the signal via interrupts and assembles eight interrupts into eight bytes. It then does a series of bitwise operations on each of the eight bytes in order to reconstruct the original byte. You will find that a few parts of the code are subject to change (the time for 0′s and 1′s can be adjusted and must be adjusted if you plan on implementing PLL or have a different desired data rate). That byte is then sent to a PC vie RS232 serial port and stored using a free program called RS232 Data Logger from Eltima Software. The code will be posted shortly under the microcontroller section on the COMP-E forum for you to use and enjoy.
- COMP-E
~ ALERT: This post does not return to main !!!