ocrdu/Arduino_SAMD21_turbo_PWM

Is this a hardware PWM implementation?

Closed this issue · 1 comments

Hi,

Thank you for creating this library! I have a question:

Is your implementation of PWM susceptible to jitter due to interrupt latency from other peripherals? I'm creating some Arduino code on Adafruit's Circuit Playground Express, and I use the Servo library to generate PWM for one servo. I discovered that when using the board's capacitive touch functions, the PWM output suffers from significant jitter. I understand this is due to interrupt latency introduced by reading the touch pins. This is a known issue with the Servo library, so I've been looking for a hardware PWM implementation for SAMD21 that would work better. I believe your library may be the answer, but I don't understand the code well enough. Please help.

Thank you for your time.

ocrdu commented

Hi,

This library uses the TCC timers in the SAMD21, which is hardware, I suppose. I don't know how the Servo library does things. There is an untested servo example here:
https://github.com/ocrdu/Arduino_SAMD21_turbo_PWM/tree/master/examples/servo
so you can test its behaviour.