PDA

View Full Version : External oscillator and startup



RussMartin
- 14th March 2007, 02:08
If using a stand-alone oscillator with a nominal 10 ms startup time, do I need to do anything special with the PIC to insure that either the oscillator or the chip is running first?

mackrackit
- 15th March 2007, 09:11
I would say no, looks like it is built in.

This is from:
http://ww1.microchip.com/downloads/en/DeviceDoc/70054b.pdf


7.12 Oscillator Start-up Timer (OST)
In order to ensure that a crystal oscillator (or ceramic resonator) has started and stabilized, an
Oscillator Start-up Timer is provided. It is a simple 10-bit counter that counts 1024 TOSC cycles
before releasing the oscillator clock to the rest of the system. The time-out period is designated
as TOST. The amplitude of the oscillator signal must reach the VIL and VIH thresholds for the
oscillator pins before the OST can begin to count cycles (see Figure 7-4).
The TOST time is involved every time the oscillator has to restart (i.e., on POR, BOR and wake-up
from SLEEP mode). The Oscillator Start-up Timer is applied to the LP oscillator and the XT, XTL
and HS modes for the Primary oscillator.

RussMartin
- 16th March 2007, 03:05
Hmm. Well, at 4 MHz, that's about 250 microseconds; at 20 MHz, about 50. The oscillator spec gives a nominal startup time of 10 milliseconds. Perhaps I should put an RC circuit on the /MCLR pin.

skimask
- 16th March 2007, 05:51
Hmm. Well, at 4 MHz, that's about 250 microseconds; at 20 MHz, about 50. The oscillator spec gives a nominal startup time of 10 milliseconds. Perhaps I should put an RC circuit on the /MCLR pin.

For one thing, we don't know which PIC you're trying to use...
Other than that, read up on the 'Power Up Timer'. 72ms of crystal-stabilizing-waiting bliss that should lay all of your worries to rest. It's always worked for me...

RussMartin
- 17th March 2007, 01:53
For one thing, we don't know which PIC you're trying to use...
Other than that, read up on the 'Power Up Timer'. 72ms of crystal-stabilizing-waiting bliss that should lay all of your worries to rest. It's always worked for me...

Thanks! Absolutely right--there it was, page 148, section 14.6, and page 184, Table 17-5, parameter 33. Even the stated (but untested) minimum of 28 ms is more than adequate!

I'm using the 16F87xA series.