PIC18F4550 pwm frequency

Thread Starter

isolete_m

Joined Jun 12, 2016
2
Hello,

I read in the datasheet that the equation for the pwm period is PWM period = [(PR2 + 1) * 4 * Tosc * PrescalerTimer2].

I need a 120Hz frequency (8.3ms period), but it seems I can't reach it. I'm using Fosc=16MHz, and by my calculations, the highest pwm period I can achieve is 1.024ms. Is that correct? Is there any way I can have 120Hz pwm frequency with this Fosc?
 

atferrari

Joined Jan 6, 2004
5,011
If you have to stick to that micro, then probably the sole way to go is reduce the Xtal frequency.

If you can select a different one, the 18F4431 for example, allows you to reach PWM lower than 50 Hz. The secret: in one of the peripheral it has an additional prescaler thta brigns everything down to what you need.
 
Top