How to Create a variable frequency output
Posted: Mon Aug 13, 2018 7:56 pm
Hi Guys,
Anyone got any good tricks for creating a variable frequency output from a 18F Pic.
I would like to have a range of frequencies between 500Hz to 3kHz, I dont need any specific values, just a range of steps.
I also after about 50% duty but anything close will do.
The PWM module only allow you to change Prescaler to three settings.
Is there a known method of changing the Period overflow and Duty values, to vary the overall freq and keep a rough 50% pwm?
I would like to do it via the PWM component, rather than discreate lines of FC creating an oscillating output pin, since there are lot of other process going on and keeping the the timing tight for a software PWM could be tricky.
Thanks, J.
Anyone got any good tricks for creating a variable frequency output from a 18F Pic.
I would like to have a range of frequencies between 500Hz to 3kHz, I dont need any specific values, just a range of steps.
I also after about 50% duty but anything close will do.
The PWM module only allow you to change Prescaler to three settings.
Is there a known method of changing the Period overflow and Duty values, to vary the overall freq and keep a rough 50% pwm?
I would like to do it via the PWM component, rather than discreate lines of FC creating an oscillating output pin, since there are lot of other process going on and keeping the the timing tight for a software PWM could be tricky.
Thanks, J.