AVR based PPM R/C interface
|optional USB interface|
|optional serial RS232 interface|
|Menu driven interactive operation|
|Diagnostic mode to display precise timings of PPM transmitter|
|Configuration of operation modes and timing parameters|
|Automatic recognition of positive and negative pulse PPM modulation|
|Generation of two interface formats understood by the popular FMS R/C flight mulator|
|Usage of R/C transmitter as Joystick through usage of free third party drivers|
|Support for an external bootloader so chip and interface can be built directly into the RC transmitter and software updates can be uploaded through USB|
If you are happy soldering the SMD chip, here is the schematic required (the inductor in the schematic is a wire with a ferrite bead):
The software is written straightforward and sometimes uses available memory quite generously for the sake of comfort and safety. Normally I try to generously comment as well.
The main functionality is provided by two interrupt routines and a free running counter 1, using an internal prescaler of 8. As I use an 8Mhz crystal, the counter therefore counts in microseconds. One interrupt routine is attached to the INT1 external interrupt pin and permanently changes it’s sensitivity for either raising or falling edges, depending on what is measured. If no level changes occur on INT1 (as no transmitter is attached or it was switched off), the counter will invariably overflow which in turn triggers the second interrupt. That will reset all measurements and flag that no transmitter is attached.
The only other point of interest is the definition of the protocols used to interface to FMS/PPJOY/PICJOY.
The 0xF0 protocol always sends at 9600 Baud fixed and starts with a Sync Byte which is 0xF0 plus the number of channels being transmitted. The first “channel” is always reserved to flag the status of some keys that were attached to the original PIC interface (see here) . In case of AVRRC, this byte is always Zero. The subsequent bytes map the stick position on each channel to a value between 0x00 and 0xEF. So a 7 channel transmitter would produce: 0xF8 0x00 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0xF8 ….
The 0xFF protocol always sends at 19200 Baud fixed and starts with a Sync Byte which is constant 0xFF plus as many bytes that map the transmitters channels between 0x00 and 0xFE. Example: 0xFF 0x80 0x80 0x80 0x80 0xFF 0x80 would be a 4 channel transmitter with sticks in center position.