Difference between revisions of "ATmega168 PPM Encoder Board"

From PaparazziUAV
Jump to navigation Jump to search
(makefile edits so LED blinks correctly on ATmega168 hardware)
Line 2: Line 2:
<p>This board plugs into the servo output ports on a R/C receiver and encodes them into a single PPM pulse suitable for the paparazzi autopilot. It is also possible to remap channels by changing the connection between the receiver and the encoder. Want Tx ch5 to be output on ch7 of the ppm stream? Just connect the Ch5 signal from the receiver to the Ch7 input on the encoder.</p>
<p>This board plugs into the servo output ports on a R/C receiver and encodes them into a single PPM pulse suitable for the paparazzi autopilot. It is also possible to remap channels by changing the connection between the receiver and the encoder. Want Tx ch5 to be output on ch7 of the ppm stream? Just connect the Ch5 signal from the receiver to the Ch7 input on the encoder.</p>
[[Image:Ppmencv3_sm.jpg|250px]]
[[Image:Ppmencv3_sm.jpg|250px]]
Note: see the [[ATmega328_PPM_Encoder_Board]] page for the more recent hardware version. Wiki refactor in progress, these pages will be merged.
= Programming the PPM encoder =
= Programming the PPM encoder =
<p>Programming the board can easily be accomplished using an AVR ISP (in-serial programming) programmer.  These are inexpensive and can be found many places online.  Once you have the ISP connected to the PPM encoder, simply use avrdude with the following command:</p>
<p>Programming the board can easily be accomplished using an AVR ISP (in-serial programming) programmer.  These are inexpensive and can be found many places online.  Once you have the ISP connected to the PPM encoder, simply use avrdude with the following command:</p>
Line 8: Line 11:
'''Source files'''
'''Source files'''
:*Link to firmware file: ''[[http://www.rcgroups.com/forums/showpost.php?p=14347844&postcount=2445 PPM Encoder Eagle and latest (4.3 Feb 2010) firmware (zip)]]''
:*Link to firmware file: ''[[http://www.rcgroups.com/forums/showpost.php?p=14347844&postcount=2445 PPM Encoder Eagle and latest (4.3 Feb 2010) firmware (zip)]]''
The above link is to ATmega326 firmware. If you load that onto ATmega168 hardware, the LED won't blink as described in the users manual (but otherwise the PPM encoder seems to work). To build firmware that works correctly on the ATmega168 hardware, edit the makefile. Find this:
# The below fuse settings are for the 328p
#Low fuse is the same for the mega 328 and mega 168
LOW_FUSE_328 = 0xDF
#High fuse sets sets the bootsize on 328 and the bodlevel in 168
HIGH_FUSE_328 = 0xD8
#Extended fuse sets the bodlevel only on 328 but it sets the bootsize on 168
EXTENDED_FUSE_328 = 0xFC
LOCK_FUSE_328 = 0xFF
and replace with:
# The below fuse settings are for the mega168
#Low fuse is the same for the mega 328 and mega 168
LOW_FUSE_168 = 0xC2
#High fuse sets sets the bootsize on 328 and the bodlevel in 168
HIGH_FUSE_168 = 0xDC
#Extended fuse sets the bodlevel only on 328 but it sets the bootsize on 168
EXTENDED_FUSE_168 = 0xF8
LOCK_FUSE_168 = 0xFF
Then "make program" (to write the fllash) and "make fuse_write" (to write the fuses).
'''Gerber & Drill files'''
'''Gerber & Drill files'''
:*download "[[Media:Eagle_pcb.zip|PPM Encoder Eagle design files 4.3(zip)]]"
:*download "[[Media:Eagle_pcb.zip|PPM Encoder Eagle design files 4.3(zip)]]"
:*download ''[[Media:Gerber_for_PPM_Encoder.zip|PPM Encoder gerber & drill files (zip)]]''
:*download ''[[Media:Gerber_for_PPM_Encoder.zip|PPM Encoder gerber & drill files (zip)]]''
:*download "[[Media:Servo2ppm_manual_v4_2.pdf|PPM Encoder manual (PDF)]]"
:*download "[[Media:Servo2ppm_manual_v4_2.pdf|PPM Encoder manual (PDF)]]"

Revision as of 16:52, 9 January 2011

Thanks to Chris we have a way to use virtually any RC receiver with Paparazzi without any modifications to the receiver.

This board plugs into the servo output ports on a R/C receiver and encodes them into a single PPM pulse suitable for the paparazzi autopilot. It is also possible to remap channels by changing the connection between the receiver and the encoder. Want Tx ch5 to be output on ch7 of the ppm stream? Just connect the Ch5 signal from the receiver to the Ch7 input on the encoder.

Ppmencv3 sm.jpg

Note: see the ATmega328_PPM_Encoder_Board page for the more recent hardware version. Wiki refactor in progress, these pages will be merged.

Programming the PPM encoder

Programming the board can easily be accomplished using an AVR ISP (in-serial programming) programmer. These are inexpensive and can be found many places online. Once you have the ISP connected to the PPM encoder, simply use avrdude with the following command:

avrdude -p atmega168 -P <Insert port here> -c <Insert ISP type here> -U lfuse:w:0b00100010:m -U efuse:w:0b111:m -U flash:w:servo2ppm+bootloader.hex


Source files

The above link is to ATmega326 firmware. If you load that onto ATmega168 hardware, the LED won't blink as described in the users manual (but otherwise the PPM encoder seems to work). To build firmware that works correctly on the ATmega168 hardware, edit the makefile. Find this:

# The below fuse settings are for the 328p
#Low fuse is the same for the mega 328 and mega 168
LOW_FUSE_328 = 0xDF
#High fuse sets sets the bootsize on 328 and the bodlevel in 168
HIGH_FUSE_328 = 0xD8
#Extended fuse sets the bodlevel only on 328 but it sets the bootsize on 168
EXTENDED_FUSE_328 = 0xFC
LOCK_FUSE_328 = 0xFF

and replace with:

# The below fuse settings are for the mega168
#Low fuse is the same for the mega 328 and mega 168
LOW_FUSE_168 = 0xC2
#High fuse sets sets the bootsize on 328 and the bodlevel in 168
HIGH_FUSE_168 = 0xDC
#Extended fuse sets the bodlevel only on 328 but it sets the bootsize on 168
EXTENDED_FUSE_168 = 0xF8
LOCK_FUSE_168 = 0xFF

Then "make program" (to write the fllash) and "make fuse_write" (to write the fuses).

Gerber & Drill files