Multiplexing with arduino


I am using arduino to control a flight controller. This flight controller (CC3D) acceptos normal PWM on each of its input channels. I am using only 4 channels so far, so I am using Servo library to send specific PWM to each digital pin of arduino.

However recently I read about PPM and multiplexing PWM. As far as I understood I can send all the channels values in a single 20ms pulse - assuming each channel is gonna last no more than 2ms, I belive I could send up to 10 channels in a single pulse.

Servo library, as far as I know, allows me only to send a single data (pulse) within a 20ms pulse. How can I use Servo libary (or any other library) in order to send more “channels” inside it?

The hardware timers inside the Arduino aren't really built for that. There are some features you could use but it would require some fairly advanced use of interrupts.

If you did it all in software (turn on output wait microseconds, turn off, wait different microseconds...) then the Arduino could do nothing else.

So if you still have enough free PWM outputs, you should keep using that method. If you don't, then first ensure you move other functions off any PWM pins and then consider upgrading to a bigger/better Arduino. A Teensy is a much more capable chip that can PWM all its pins. And it is physically smaller.

I've recently fallen in love with the Teensies. The 3.2 is the same size as the Pro Micro but is far, far more capable. And it's offered at about the same price point.

Then there are the new 3.5's and 3.6's. Lovely overkill as far as I'm concerned. Nothing I've worked on so far comes anywhere close to maxing out their capabilities.