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

RC Navy

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

in complement of the interrupt-driven RC PPM frame generator for Digispark, Digispark pro and UNO described in this topic: http://digistump.com/board/index.php/topic,1682.msg7801/topicseen.html#msg7801, here is an interrupt-driven RC PPM frame reader for Digispark, Digispark pro and UNO.

Features:
  • Based on TinyPinChange library: can use any pin supporting pin change interrupt
  • Can read the pulse widths of up to 9 RC channels
  • Can read Positive and Negative PPM modulation
  • Detect automatically the number of RC channels transported in the PPM frame
  • Synchro indicator provided (for synchronization purpose)

Use case examples:
  • Standalone PPM reader!
  • Channel substitution in an existing PPM frame (in conjunction with TinyPpmGen library)
  • Digital data transmission over PPM (in conjunction with TinyPpmGen library)
  • Channel permutation (in conjunction with TinyPpmGen library)

Blocking fonctions such as delay() can be used in the loop() since PPM reader and PPM generator libraries are interrupt driven.

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:
https://github.com/RC-Navy/DigisparkArduinoIntegration/tree/master/libraries/DigisparkTinyPpmReader

RcPpmChSubst example demonstrates how to substitute a custom pulse width for a specific RC channel:
https://github.com/RC-Navy/DigisparkArduinoIntegration/blob/master/libraries/DigisparkTinyPpmReader/examples/RcPpmChSubst/RcPpmChSubst.ino

Feel free to test/use it, feedback appreciated.