Encoder - arthurbenemann/ardupilot GitHub Wiki

Note: !ArduPilot Mega comes with the PPM encoder/failsafe pre-programmed, and most users will never need or want to modify it. (Indeed, the point of black-boxing the chip like this is people don't mess with the code and introduce bugs that could stop the failsafe from working properly). However, some users may want to get into the code to change the way !ArduPilot Mega interprets RC signals (the original source code is here. Also, some early boards may have been misprogrammed and need to be reflashed. If so, these guides will show you how to program this chip.

Using the Atmel AVRStudio tools and STK500 programmer

Using the low-cost BusPirate and free AVRDude tool