Author Topic: An interrupt driven RC PPM frame generator for Digispark, Digispark pro and UNO  (Read 9564 times)

RC Navy

  • Jr. Member
  • **
  • Posts: 54
  • When you like, even too much, it is not enough!

TinyPpmGen is a tiny accurate (interrupt driven) RC PPM frame generator library using compare match of the timer used for ms in the core (Timer0).

  • Uses Output Compare Channel A of Timer 0. When used, it disables PWM associated to Timer 0 -> Pin marked as "OC0A" shall be used as PPM Frame output (no other choice).
  • Can generate a PPM Frame transporting up to 8 RC Channels (600 -> 2000 us) or 7 RC Channels (600 -> 2400 us)
  • Positive and Negative Modulation supported
  • Constant PPM Frame period: 20 ms
  • No need to wait 20 ms to set the pulse width order for the channels, can be done at any time
  • Blocking fonctions such as delay() can be used in the loop() since it's an interrupt driven PPM generator
  • Supported devices:
    • ATtiny167  (Digispark pro: PPM output -> PA2 -> arduino pin#8)
    • ATtiny85   (Digispark:     PPM output -> PB0 -> arduino pin#0)
    • ATmega328P (Arduino UNO:   PPM output -> PD6 -> arduino pin#6)
Available in my Github repository:

Feel free to test/use it, feedback welcome.


  • Newbie
  • *
  • Posts: 3
This is awesome, exactly what I was looking for!  It's working great via trainer cable to my JR XP662 (75MHz).  I'm sending 6 channels with TINY_PPM_GEN_POS_MOD and 22500 period (might work at 20,000, didn't test).  The main thing I had to do to get it working was add a 4.7K resistor on the data line.  Also the output is on pin 8 on the Digispark Pro, not pin 0 (pull request sent!)

Here's my work-in-progress data-uplink controller for a future project:


  • Sr. Member
  • ****
  • Posts: 289
@RC Navy: I don't know what all that means, but it *sounds* pretty cool. Something something remote control something. ;)

@jweather: I'm wondering if there's a good story behind that melted scorch mark on your breadboard. ;)


  • Newbie
  • *
  • Posts: 3
That would be the ergonomically contoured thumb rest.  Also happens to be what's left of that side after trying to power 10 meters of RGB LED strips (somewhere around 6A at 12V).

Here's the full project writeup for the skywriting rig:


  • Newbie
  • *
  • Posts: 1

Long time since the last post but maybe someone is still active on this project. I want to use it in one of my projects at first, thanks to the very good work!
My system is running on an ATTINY85, the TnyPpmGenSweep is working fine, but when I will do some additional things like reading and writing digital IOs the pos PPM switches sometimes to neg PPM.
Have anyone seen similar issues and an Idea how to solve this?

In The TnyPpmGen.cpp I read the sentence: #warning TO DO: fix issue with positive modulation ! (bad signal randomly generated).

Thanks in advance for your help,