Wednesday, July 24, 2013

PPM Output (Draft - Looking for testers)

If we have code capable of generating servo signals its very simple to adapt this to generate a PPM output instead.

In a previous post we looked at reading an incoming PPM signal and we saw how the PPM Signal describes the individual servo pulses -

To generate the PPM Stream from a set of servo commands all we need to do is change our code to toggle a single pin instead of individual pins for each servo.

If we look at the point where the channel 1 pulse ends and the channel 2 pulse starts in the diagram above. The code needs to find which pin is associated with the current chanel, then set the pin low to end the pulse. It then finds the next channel, sets its pin high and then sets the timer compare register so that a interrupt routine will be called again when its time to end the new channels pulse and start the next channels pulse.

To output PPM its actually a lot simpler. We are always dealing with the same pin so all we need to do is set the pin high, set the compare register so that the interrupt is called again to when we need start the next channel pulse and then we immediately set the PPM pin low again and exit. Systems which expect a PPM Input are only interested in the rising edge of the PPM Pulse so once we have set it high (giving the external system the rising pulse edge it is looking for) we can immediately set it low again and get out.

Timers, Compare Registers, Service Routines

The following posts provide an indepth background to how the standard Arduino Servo library uses timers, compare registers and interrupt service routines to control upto 12 Servos. The RCArduinoFastLib uses the same approach with a number of optimizations including support for more servos, faster refresh rates, dual refresh rates and reading incoming PPM signals. The remainder of this post presents a small modification of the RCArduinoFastLib which will provide a PPM output instead of individual servo channels.

Background posts
Standard Arduino servo library overview


The Modified RCArduinoFastLib with PPM Output
Looking for testers, PM me Duane B on the Arduino forum for a zip folder to build the library and test sketch.


  1. Very interested in the library. Tried to reach you via Arduino forum with no luck. Could you check your account or contact me at
    THX a lot, Kai

  2. Sent, let me know that you have received it.


  3. Got it! Thanks. Will test it asap...

  4. Duane,

    sent pm at arduino forum, but posting here just in case... also interested in trying out your library. contact info: timsenecal(at)


    Tim Senecal

  5. Duane,

    I also forwarded you request via PM on the Arduino forums to test your new modified library.

    Does the PPM output modification change the entire functionality of the library or is it additional functionality to the original posted RCArduinoFastLib library?

    Thank You

    1. You should be able to download a zip here -


    2. Its basically the same library but instead of toggling lots of different pins to drive individual servo channels, it toggles a single pin to generate PWM. Apart from the pin toggling, its the same code.


  6. Hi Duane - very impressed by your Arduino RC work here. I've used a Duinotech compatible UNO and been able to interface my JRPROPO 6-channel XP662 TX and R700 RX such that I can read all 6 channels from the PPM stream. However I am most interested in getting the UNO to produce its own PPM output stream but after trying many things I've been unable to generate any PPM stream output. I see that some time has passed since you last posted on this.Are you still interested in PPM stream output? I'm available to help as required. Thanks!

  7. Solved! Hi Duane, based on your Fast Servo library, I now have a Uno and a Mega 2560 which can generate a 6 channel Buddy Box signal - also known as Trainer or Direct Servo Control (DSC) signal. Check out my explanation / tutorial at:

    1. Can you post your code on github or Google drive?

  8. Hello Duane .
    I keep looking and do not find anything as I wish . Your projects are the closest to what I seek . Any idea, can be as exiting the Arduino to have PWM signal and no servo or ESC ? I like the RC transmitter to control DC motors .

    Thank you.

  9. If you want your ex-girlfriend or ex-boyfriend to come crawling back to you on their knees (even if they're dating somebody else now) you need to watch this video
    right away...

    (VIDEO) Get your ex back with TEXT messages?

  10. Thanks Great Post. We are professional, delivering a world-class moving, relocation, removal, and storage solutions at highly competitive market prices in Dubai-UAE.
    movers in dubai
    best movers in dubai
    best movers and packers in dubai
    Cheap in dubai
    office movers in dubai

  11. Thanks Great Post. We are professional, delivering a world-class moving, relocation, removal, and storage solutions at highly competitive market prices in Dubai-UAE.movers in dubai, best movers in dubai, best movers and packers in dubai, Cheap movers in dubai, office movers in dubai. Respond in 24 hours, Phone: +971-526062215 East West Mover company that offers local movers, residential, commercial and worldwide moving services.

  12. I was watching this video on youtube, a door unlocker using knocks, the arduino reas your knocks and compares, if its a match , it opens the door!