2003-04-29 07:33 AM
2011-05-17 02:53 AM
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.2011-05-17 02:53 AM
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