Introduction
In radio frequency (RF) transmission, the commonly used data structure includes: NEC, Manchester, Serial, etc. Among the three, Serial enjoys the highest efficiency, Manchester the second, and NEC the lowest. As for system requirement, however, Serial usually needs highly precise timing. This requires the use of crystal oscillator and hence increases the cost. The other two don’t need precise timing, but their decoding methods are more complex.
This article provides a low-cost yet efficient RF transmission solution that uses the internal RC oscillator of AM8EBXX MCU.
About the MCU
AM8EBXX series MCUs provide multiple oscillator modes. The internal RC oscillator offers a frequency range of 32KHz to 20MHz, with instruction cycle frequency up to 5MHz. The nominal bias of the RC oscillator is from -6% to +6%. For safer result, we use -10% to +10% here in our calculation.
Decoding method
Decoding RF data is essentially to distinguish different pulse widths. Take Manchester encoding as an example. In Manchester encoding, a 1 to 0 change represents 0, and 0 to 1 change represents 1.
Suppose the current highest baud rate is 256us, and there is a data string “0111”, then its data structure will be:
As we can see that if the 256us and 512us pulse widths can be distinguished, decoding can become quite simple. Then how to tell them apart? With an MCU system, a common solution is through query. That is, to check the status of the RF data wire at regular intervals. This method is easy and resource saving, and is therefore widely used in practice.
... ...