PWM registers?

BuGless
Posts: 10
Joined: Wed Sep 09, 2015 1:28 am

PWM registers?

Postby BuGless » Wed Sep 23, 2015 6:19 pm

I'm in need of actually only one PWM (one frequency), but with five or possibly even six outputs with six different duty cycles.
Is there documentation regarding the PWM configuration registers? Sample code?
Any suggestions on how I create one or two extra PWM outputs with a different duty cycle (but same startphase)?

I'm trying to avoid involving yet another MCU.

ESP_Sprite
Posts: 25
Joined: Fri Oct 24, 2014 7:58 pm

Re: PWM registers?

Postby ESP_Sprite » Wed Sep 30, 2015 2:06 pm

There's no PWM hardware as such, but the SDK has a pretty capable software PWM implementation. Check the pwm_* functions in the SDK, they probably do what you want.

BuGless
Posts: 10
Joined: Wed Sep 09, 2015 1:28 am

Re: PWM registers?

Postby BuGless » Thu Oct 01, 2015 8:27 am

Interesting.
This begs the question though, what is the resolution of the PWM pulses, and how accurate does it maintain fixed phase relationships between different PWM channels?
How well can it guarantee that the width of the pulses stays unaltered?

I'm trying to reach 25ns resolution with respect to pulsewidth and phase difference in order to be able to switch 240VAC MOSFETs on and off in sync without creating electrical shorts among them.

dkinzer
Posts: 52
Joined: Fri Jul 31, 2015 7:37 am

Re: PWM registers?

Postby dkinzer » Thu Oct 01, 2015 10:39 am

BuGless wrote:what is the resolution of the PWM pulses, and how accurate does it maintain fixed phase relationships between different PWM channels?
Look at the PWM example code included in SDK version 1.0.1b2 (and earlier). It is quite likely (probably certain) that the PWM code now part of the SDK is based on the earlier example code.

I would guess that 25nS resolution is not likely.
Don Kinzer
Beaverton, OR, USA

BuGless
Posts: 10
Joined: Wed Sep 09, 2015 1:28 am

Re: PWM registers?

Postby BuGless » Thu Oct 01, 2015 3:48 pm

Indeed. Seems you are right. That will mean I need to design in an extra MCU to control the PWMs. Thanks for the input.

Who is online

Users browsing this forum: No registered users and 2 guests