Hi Guys
I have never worked with the PWM module before, am trying to get the frequency setting at 100Hz, have changed the clock frequency of the PIC to 100Hz but not sure if this is the correct way?? The help page does not describe the Period etc very well, very vague.
Thanks for assistance
Ted
PWM and Frequency setting
Moderator: Benj
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: PWM and Frequency setting
Hi Ted,
Not a good idea to change the clock frequency to 100Hz as it will have a dramatic effect on any other components like LCD RS232 I2C etc.
100Hz is very low for a PWM signal.
The only way to set the 8bit or 10bit PWM to 100Hz is to reduce clock speed to 1MHz.
For PWM frequencies as low as 100Hz it may be better to use bit bang method.
There are numerous examples on these forums of bit bang PWM.
For example here.
If you get suck I can help you further.
Martin
Not a good idea to change the clock frequency to 100Hz as it will have a dramatic effect on any other components like LCD RS232 I2C etc.
100Hz is very low for a PWM signal.
The only way to set the 8bit or 10bit PWM to 100Hz is to reduce clock speed to 1MHz.
For PWM frequencies as low as 100Hz it may be better to use bit bang method.
There are numerous examples on these forums of bit bang PWM.
For example here.
If you get suck I can help you further.
Martin
Martin
-
- Posts: 79
- Joined: Sat Mar 14, 2015 7:52 am
- Has thanked: 46 times
- Been thanked: 26 times
- Contact:
Re: PWM and Frequency setting
Hi Martin
Thank you for your help, as always it is greatly appreciated, will try your advice and play around with it.
Will let you know how I go.
Regards
Ted
Thank you for your help, as always it is greatly appreciated, will try your advice and play around with it.
Will let you know how I go.
Regards
Ted