cancel
Showing results for 
Search instead for 
Did you mean: 

PWM

shermantec
Associate II
Posted on February 17, 2004 at 07:51

PWM

4 REPLIES 4
shermantec
Associate II
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 II
Posted on May 17, 2011 at 11:58

Latino,

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

as per datasheet.

Regards

sjo
shermantec
Associate II
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 II
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