CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

1Hz PWM signal, any ideas?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 19, 2008 7:47 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group