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 CCS Technical Support

Changing oscillator type within code

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



Joined: 09 Jul 2004
Posts: 10

View user's profile Send private message

Changing oscillator type within code
PostPosted: Wed Aug 24, 2005 8:46 am     Reply with quote

Hello,

I have a power sensitive application using an 18LF8722 running at 3.3V/24MHz. The oscillator is an Epson SG350 module (http://www.eea.epson.com/go/Prod_Admin/Categories/EEA/QD/Crystal_Oscillators/all_oscillators/go/Resources/TestC2/SG350SCF_SDF_SEF). This module has a shutdown input. When it's either high impedance or at logic 1 the oscillator runs. When it's pulled low it shuts down.

My query relates to this functionality. Does anybody have any experience of changing oscillator type whilst running? Is this possible? What I'd like to do is switch to the internal oscillator, running at the lowest speed possible, and disable the 24MHz module. Then, when high speed is needed it would be good to be able to switch the 24MHz module on again, and switch back to it. There won't be any need for accurate timing when in this mode. I just want to be able to service a few trivial functions.

So, does anybody have any thoughts on the viability of tying the shut-down pin on the module to an I/O on the PIC, setting the level of the pin to 1 before enabling the tri-state as an output, and then switching to the internal oscillator before setting the I/O pin low?

The design needs to be very robust, I can't risk the PIC choking on the clock and then just halting.

Thanks for your thoughts.

Steve.
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 9:33 am     Reply with quote

If I were designing this, and the 24MHz didn't need to be exact, I would design an RC oscillator with a logic input. When the input is active the RC runs at 24MHz. When the input is inactive the RC runs slow and low power. Then just set up the PIC for external clock.
You could look at V/F converter chips for a start, but you can do something simpler as you don't need linearity.
_________________
The search for better is endless. Instead simply find very good and get the job done.
SteveC



Joined: 09 Jul 2004
Posts: 10

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 9:53 am     Reply with quote

Hello,

Thanks for the reply. The 24MHz does need to be accurate, I'm afraid - It's used to derive the timings for a TI DSP based acquisition system.

Steve.
Ttelmah
Guest







PostPosted: Wed Aug 24, 2005 10:26 am     Reply with quote

What you describe, should work, with some 'caveats'. The first is how long does the Epson module take to start?. When you want to switch to high speed mode, the oscillator needs to be switched on for long enough to let the oscillator start and stabilise, before you trigger the oscillator change. The same applies going the other way, with the T1 Oscillator being started long enough before switching to ensure that it is running OK. The oscillator module here, is not specified for use with a RC oscillator, and I'd perhaps consider using a watch crystal, which it is designed for, and would run in it's 'low power' mode. However testing would show how well the RC oscillator would run, but with the possibility that other versions of the chip might differ in this regard...
I might be tempted to 'reverse' the oscillator logic. If you feed your external clock into the T1 input, you can then set the main system oscillator to be the internal 32KHz RC source. The system will then wake up in 'slow' mode, and will only change to full speed when you trigger the switch to the T1 clock. Nicely, it'll then always fall 'back' to the safe RC internal oscillator. This would give the lowest component count. You woud still nee to have a delay when switching to the fast oscillator, for it to start, but potentially this should do what you require.

Best Wishes
SteveC



Joined: 09 Jul 2004
Posts: 10

View user's profile Send private message

PostPosted: Wed Aug 24, 2005 10:36 am     Reply with quote

Hello Ttelmah,

What you describe is very, very close to what I proposed. I was not intending to use an external RC oscillator. I was intending to use the internal 32kHz oscillator and the external 24MHz module. I hadn't thought of making the 32kHz oscillator the default. That is a nice idea.

So, there are no additional components at all. Just a little bit of copper between the oscillator enable line and the standby pin on the module.

I'll prototype it, and let you know.

Thanks

Steve.
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