Synchronous PWM on two pins

CircuitPython on hardware including Adafruit's boards, and CircuitPython libraries using Blinka on host computers.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
BrianLloyd
 
Posts: 2
Joined: Tue Jan 24, 2023 2:47 pm

Synchronous PWM on two pins

Post by BrianLloyd »

Board: ItsyBitsy M4

I have an application requiring two pins to be doing synchronous PWM. The duty cycle is the same for both pins but the pulses are equally spaced and complementary. At 100% duty cycle the two pins would have square waves 180° out of phase. I need to be able to vary the frequency and/or pulse width. Clearly the TCC for the ATSAMD51 can do this but I don't see the capability in the pwmio library.

Has anyone done this and, if so, how can it be done in CircuitPython?

Thanks in advance.

User avatar
mikeysklar
 
Posts: 13936
Joined: Mon Aug 01, 2016 8:10 pm

Re: Synchronous PWM on two pins

Post by mikeysklar »

The TCC/TC are auto-configured with circuitpython and pwmio. You can build your own CircuitPython to customize them, but even within that there have been reports of initialization order being complicated.

This seems like a good issue to bring up with the CircuitPython github repo as it is a reasonable feature to support in the future.

Locked
Please be positive and constructive with your questions and comments.

Return to “Adafruit CircuitPython”