Skip to main content
shermantec
Associate III
February 17, 2004
Question

PWM

  • February 17, 2004
  • 4 replies
  • 733 views
Posted on February 17, 2004 at 07:51

PWM

This topic has been closed for replies.

4 replies

shermantec
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:58

Hello Sjo ,

How you got this number , is this is the right formula :

output max. around 23.4 kHz. =24MHz/(2*2*256)

Latino
sjo
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:58

Latino,

Max Pwm = (24000000/2)/(0+1) = 12MHz

as per datasheet.

Regards

sjo
shermantec
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:58

Hello

Can you find me the max freq I generate from one of the

PWM ports (I'm using 24Mhz Crystal for the uPSD3234).

Thanks ahead

Thanks

Latino
sjo
Associate III
May 17, 2011
Posted on May 17, 2011 at 11:58

Sorry,

Didn't put all the information.

The formula above calculates the input frequency to the pwm unit.

which for 12MHz is 6MHz = fOSC / 2 / (prescaler data value + 1)

from this we can calculate fPWM8 which is our output pwm.

fPWM8 = (fOSC / prescaler0) / (2 x 256)

we cannot use 0 or 0xFF as these will give us a permanent high or low.

the actual maximum frequency is obtained from a prescaler0 of 1

so maximum frequency is 23437.5Hz for 12MHz clock.

Regards

sjo