![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Oli Guest
|
Clock switching? |
Posted: Tue Sep 27, 2005 7:28 am |
|
|
Hi
Im intending on using a PIC from the nanoWatt series - probably the pic16f684 or similar. I've been reading through the datasheet - I would like to use clock switching, as detailed on P26/27 of the datasheet. I would like it to idle using the LF clock, and then be able to switch to the HF clock upon demand. How do I go about doing this in CCS?
Any help appreciated, thanks! |
|
![](templates/subSilver/images/spacer.gif) |
Oli Guest
|
...anyone? |
Posted: Mon Oct 03, 2005 2:42 am |
|
|
Can anyone shed any light on this? pointers? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Mon Oct 03, 2005 4:08 am |
|
|
setup_oscillator.
Basically, on parts supporting it, you setup the external oscillator, with the fuses statement, then use:
setup_oscillator(OSC_31KHZ);
#use_delay(CLOCK=31250)
To change to the low speed oscillator (and keep time delays correctly programmed).
setup_oscillator(OSC_NORMAL);
To switch back.
If you use any software time delays, remember that these are hard-coded, based on the last 'use_delay' statement, so if times need to be accurate, you will have to structure the program flow, to ensure that the correct use_delay, was the last one met, before a delay is used.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Oct 03, 2005 4:00 pm |
|
|
Read the header file for the pic16f684 and see if there is reference to clock modes there. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|