PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Jun 19, 2008 7:47 pm |
|
|
This thread has the formula to find the lowest PWM frequency for the
hardware PWM module. You'll find that you can't go as low as 1 Hz.
http://www.ccsinfo.com/forum/viewtopic.php?t=17993
For a software routine that can be modified to work at 1 Hz, see my
post near the start of this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=20050
See my comments at the end of this thread for instructions on how
to reduce the PWM frequency with that software routine:
http://www.ccsinfo.com/forum/viewtopic.php?t=30175
I suggest that you change the RTCC divisor to 64 or 128, and
then increase the LOOPCNT value as required. These are the
two lines that you will need to change:
Code: |
#define LOOPCNT 39
setup_counters(RTCC_INTERNAL, RTCC_DIV_1);
|
-------
Edited to fix one of the links.
Last edited by PCM programmer on Thu Sep 11, 2008 3:51 pm; edited 1 time in total |
|