cancel
Showing results for 
Search instead for 
Did you mean: 

PWM frequency

kobihaun
Associate II
Posted on April 29, 2003 at 16:33

PWM frequency

2 REPLIES 2
joseph2399
Associate II
Posted on May 17, 2011 at 11:53

The desired PWM frequence is set by the user. You need to find out the prescaler value which is used to divide the main system clock to form the input clock to the selected PWM channel.

Prescaler value = [(fosc/2)/fpwm] - 1 , this value is loaded to the PSCL0L and PSCL0H registers. The duty-cycle is set in the PWMx registers. These registers have 8-bit resolution, so a value of 0x7F, being half way, will give you a 50% duty-cycle pulse.
kobihaun
Associate II
Posted on May 17, 2011 at 11:53

Hi every body

I am using uPSD 3200.

If there is any body that can explain to me the PWM frequency calculations, I will be glad.

Thank you very much

Hayun