Hello everyone!
After reading the data sheet properly, I've updated my hardware servo library to use all available PWM channels and all available output pins, see the following table. This overrides the Arduino distribution variant.cpp pin configuration g_APinDescription[] for the Due, which is far from complete.
| PWM Pin | Channel |
|---|---|
| 6 | 7 |
| 7 | 6 |
| 8 | 5 |
| 9 | 4 |
| 17/RX2 | 1 |
| 34 | 0 |
| 36 | 1 |
| 38 | 2 |
| 40 | 3 |
| 43 | 2 |
| A8 | 1 |
| A9 | 2 |
| A10 | 3 |
| DAC1 | 0 |
| CANTX | 3 |
This means you can output a servo signal to any of the above pins, but only one pin per channel. For example, you cannot output two different servo signals on pin A10 and CANTX at the same time because they are both driven by the hardware PWM channel 3.
It is possible to output a servo/PWM signal on a bunch of other pins as well by using the complementary PWM signal for each channel but the above pins suit me well enough not to warrant writing the code for handling inversion of duty cycle parameters (and thereby increasing the runtime size of the code)
To use the library, simply unpack the ZIP into your libraries folder, restart Arduino and open the DueServo example Sweep.
DueServo.zip (2.55 KB)