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

Clock switching

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



Joined: 08 Jan 2008
Posts: 5

View user's profile Send private message

Clock switching
PostPosted: Tue Feb 12, 2008 9:56 am     Reply with quote

Could someone please explain the method of how to perform clock switching using the CCS compiler V4.064?

In the main() loop I want to perform what I call 'Normal functions' at full processor rate based on an external crystal (8MHz).
Once complete I want to switch the PIC into sleep() mode and clock this mode at 32khz using the 'INTRC' internal RC .

I have performed such a function based on assembly code in the past and I know that the PIC18F45J10 I am using is capable of it. I am just not sure how to create this task using the CCS software.

I have search the forum and the documentation and haven't found any method which does something similar.

The intention of performing this clock switching is to reduce current drain
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

Re: Clock switching
PostPosted: Tue Feb 12, 2008 12:10 pm     Reply with quote

lambcutlet wrote:
Could someone please explain the method of how to perform clock switching using the CCS compiler V4.064?

In the main() loop I want to perform what I call 'Normal functions' at full processor rate based on an external crystal (8MHz).
Once complete I want to switch the PIC into sleep() mode and clock this mode at 32khz using the 'INTRC' internal RC .

I have performed such a function based on assembly code in the past and I know that the PIC18F45J10 I am using is capable of it. I am just not sure how to create this task using the CCS software.

I have search the forum and the documentation and haven't found any method which does something similar.

The intention of performing this clock switching is to reduce current drain


The term 'Sleep' has an established meaning that the processor is not executing instructions. The mode you want would be 'Low-Power' because the processor would continue to execute instructions.

A better option would be to clock the processor from the internal oscillator for high speed. Then use an external 32Khz xtal for low-power mode. The internal oscillator @ 32Khz will consume more power than an external xtal @ 32Khz.
lambcutlet



Joined: 08 Jan 2008
Posts: 5

View user's profile Send private message

PostPosted: Tue Feb 12, 2008 3:07 pm     Reply with quote

When I mention sleep() mode.
The idea was to only run the Watchdog timer during this period and when it has rolled over, the PIC would return to full speed performing its duties and then return to this low power state.
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Tue Feb 12, 2008 4:34 pm     Reply with quote

lambcutlet wrote:
When I mention sleep() mode.
The idea was to only run the Watchdog timer during this period and when it has rolled over, the PIC would return to full speed performing its duties and then return to this low power state.


Then you do not wish to switch clock source, only to enter sleep mode. Look in the manual for the word sleep().
Peter-NMB



Joined: 17 Sep 2003
Posts: 11
Location: Glasgow, Scotland

View user's profile Send private message

PostPosted: Wed Feb 13, 2008 6:07 am     Reply with quote

This may be of use of use to you, seems to contain most of the items you are looking at to do Shocked

http://www.ccsinfo.com/forum/viewtopic.php?t=31308&highlight=40ua
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