Low frequency PWM?

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
ule
Posts: 18
Joined: Tue Jan 13, 2015 7:58 pm
Has thanked: 4 times
Been thanked: 2 times

Low frequency PWM?

Post 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.

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Low frequency PWM?

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Low frequency PWM?

Post 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

ule
Posts: 18
Joined: Tue Jan 13, 2015 7:58 pm
Has thanked: 4 times
Been thanked: 2 times

Re: Low frequency PWM?

Post 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.

Post Reply