Using TC4 to generate a single pulse on SAMD21 (Adafruit Feather M0)

Hey Martin,

I made some changes to my motor-delay software and we haven't seen a speed-spike since! :slight_smile:

I appreciate your suggestion to read the STOP bit in the TC's STATUS register, but I went with something a little different... I decided to queue any asynchronous speed change requests and then implement queued timing changes immediately after the TC3_Hander() interrupt is called to create the trailing edge of the triac pulse. This seems to work well.

As I noted in my previous post, I'm updating my drive pulse timing every 50ms and the pulses occur on an 8.3ms period. There is about 1.5ms between the pulse's trailing edge and the next zero crossing-- plenty of headroom to implement the change.

Thanks again for your quick and always-on-point feedback.
Randy

P.S. For your amusement, I uploaded a video of our carbonation machine in action— with no speed hiccups!