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
Re: Clock switching
Posted: Tue Feb 12, 2008 12:10 pm
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
Posted: Tue Feb 12, 2008 3:07 pm
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
Posted: Tue Feb 12, 2008 4:34 pm
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().
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