PDA

View Full Version : 2 HPWM's at different frequencies?



jmgelba
- 18th February 2012, 17:17
18F2550 running on external 20mhz resonator. I'm trying to get HPWM 1 to run at 30KHz and HPWM 2 to run at 1KHz. Both appear to run at 1KHz. Any way around this?

The 30KHz is being used for a boost switcher and the 1KHz is used as LED dimming on the output of the boost switcher.

gadelhas
- 18th February 2012, 19:18
18F2550 running on external 20mhz resonator. I'm trying to get HPWM 1 to run at 30KHz and HPWM 2 to run at 1KHz. Both appear to run at 1KHz. Any way around this?

The 30KHz is being used for a boost switcher and the 1KHz is used as LED dimming on the output of the boost switcher.

On that chip bot hPWM pin's uses Timer 2, so the frequency must be the same.
You can use Software PWM or change Chip.

cc1984
- 18th February 2012, 21:20
You could set the faster frequency (30K) and then add a divide by 30 circuit on the 2nd hpwm output to get the 1KHz. Think that should work.