Page 1 of 1

Low frequency PWM?

Posted: Sun Feb 05, 2017 4:43 pm
by ule
I'm testing some pwm program with pic 12F617. Everything works fine, but I wonder how to set frequency of pwm to 10Hz or less. If I set clock speed to 1MHz and prescaler divide to 16, I get only 61,03516 Hz.

Re: Low frequency PWM?

Posted: Sun Feb 05, 2017 7:22 pm
by QMESAR
Hi
Such low frequencies are not always possible with pic's look in the device datasheet and it will tell you what is the minimum PWM frequency you can get with various Clock frequencies
with the hardware pwm module you can also use timers and do your own PWM to achieve 10Hz

Re: Low frequency PWM?

Posted: Thu Feb 09, 2017 12:14 pm
by Benj
There is an example of software PWM using a timer interrupt available here which may help.
http://www.matrixtsl.com/article.php?a=52

Re: Low frequency PWM?

Posted: Thu Feb 09, 2017 1:19 pm
by ule
Thank you for input. Yes, I saw that example. But I also find this topic, here on forum. The last two examples are very helpfull. I made it that way and I get pwm signal with 10Hz frequency.