Skip to main content
kobihaun
Associate II
April 29, 2003
Question

PWM frequency

  • April 29, 2003
  • 2 replies
  • 583 views
Posted on April 29, 2003 at 16:33

PWM frequency

This topic has been closed for replies.

2 replies

kobihaun
kobihaunAuthor
Associate II
May 17, 2011
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

joseph2399
Associate II
May 17, 2011
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.