Message Encoding
Individual bits are encoded by the driver using Manchester encoding. Sending a single bit with Manchester
encoding requires that the value be sent during the first half bit-time and its complement sent during the
second half bit-time. For example:
1 Æ ¯¯|__
0 Æ __|¯¯
The pulse-width modulation (PWM) mode of the MCU’s timer module is used to produce this waveform:
•
•
Set the timer modulus to the pulse width (this depends on the data rate)
Set the output compare value to 0.5 modulus (50% duty cycle)
An interrupt occurs at output compare and we can set up for the next bit at this point.
The actual set up to send a single bit differs only slightly. The difference is to set high-true pulses or
low-true pulses for a 1 or a 0, respectively.
NOTE
The driver requires close control of the timer channel it is using, along with
the associated timer channel interrupt vector and pin. It also requires control
of the timer modulus to set it up for a single bit-time. However, after it is set,
the modulus is not modified further and can be used reliably on another
timer channel. The driver can be configured via the header file #define
ECHO_TIMER_DISABLEto leave the timer turned on even when the driver is not
using it.
When the Manchester encoded bit-stream is presented to Echo, it is modulated onto the carrier using on-off
keying (OOK) or frequency shift keying (FSK) for RF transmission.
Upon reception, Echo demodulates the RF signal and the data manager then removes the Manchester
encoding, reducing the processing required on the MCU.
Figure 2 shows the sequence of events in an application where a message transmission is triggered by
pressing a switch on one board, resulting in a LED flashing on another board.
Software Drivers for MC33696, Rev. 1
4
Freescale Semiconductor