PDA

View Full Version : several oscillators



ozzieB
- 14th April 2009, 08:16
HI,

Im working on a project with HPWM, I need to get 1 pwm frequency between 1-29 kHz and a duty cycle from 0 to 99,9% by steps of 0,1%...
I tried it with a 16 mHz oscillator but the duty cycle steps are 0,4% sometimes..
so i want to use several oscillators... is there a way to do that?
because just put another define in de program dont work..

Chris Barron
- 14th April 2009, 09:16
HI,

Im working on a project with HPWM, I need to get 1 pwm frequency between 1-29 kHz and a duty cycle from 0 to 99,9% by steps of 0,1%...
I tried it with a 16 mHz oscillator but the duty cycle steps are 0,4% sometimes..
so i want to use several oscillators... is there a way to do that?
because just put another define in de program dont work..


2 options which I can see are to go for a 40MHz pic and use the HPWM, or use software PWM of your own design (If you can accept the program running in a long loop. If yoiu need to pic to perform other tasks such as read buttons or get an A/D result, then wait for the longest PWM period (either high or low) and do the extra work then, making sure you return to the PWM code before a timer elapses for example.