0

Controlling PWM polarity and phase
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Controlling PWM polarity and phase

by robhelvestine on Wed Jan 29, 2020 12:49 pm

Is there a way in CircuitPython to control the polarity of the PWM output signal? How about the phase? I need two PWM signals that are synchronized; Controlling phase and polarity would solve this for me.

Thanks,
Rob

robhelvestine
 
Posts: 2
Joined: Tue Jan 14, 2020 4:03 pm

Re: Controlling PWM polarity and phase

by tannewt on Wed Jan 29, 2020 3:26 pm

Hi Rob, we don't currently expose polarity and phase control in the Python API. You can likely get synchronized phase (both rising edges at the same time) by carefully picking the pins. When a PWMOut is created with a fixed frequency (on SAMDs at least) we try to use the same timer as an existing PWMOut with a different capture compare channel. That means they'd be in sync. We use separate timers when the base frequency may change or if the desired pin cannot be controlled by the existing timer.

What are you using it for? Is that enough?

tannewt
 
Posts: 1490
Joined: Thu Oct 06, 2016 8:48 pm

Please be positive and constructive with your questions and comments.