PIC oscillator Q

It seems that an un-programmed PIC will not oscillate; the OSC pins are at ground in the "raw" state, and 10Megs between them obviously will not get them to logic (linear) level.

So, ASS-u-ME that the PIC is minimally programmed for an external

20Mhz crystal and one would like it to oscillate at that frequency and not higher, what changes would be needed, based on my old Semi-universal oscillator:

Copied from "Semi-universal CMOS Xtal OSC" 11/11/2008 4:55 AM

Plug crystal into appropiate socket; each has its specified load. The drive resistor shown is the maximum value that allows all frequencies of a given type to oscillate; some frequencies work with higher R values (less drive). NOTE: in *all* cases the frequency is higher than marked ( expected) value. Made using a 74AC02 which oscillates near 140Mhz with no Xtal plugged in (amplitude about 1V pk-pk at 5V supply).

Xlo (Khz) 10M Marking | Measured +-----/\/\----+ --------+----------- | | 32 | 32.7711 | |\ | | 32.7710 +-----| >o----+---+ | 32.7721 | |/ | | --------+----------- | \ | 100 | 100.0033 | 680K / | | 100.0042 | \ | --------+----------- | Xlo | | 200 | 200.0951 +-----o o----+ \ --------+----------- | | / 6.8K 1000 | 1000.386 --- 10p --- \ --- 22p --- | Xhi (Mhz) | | | Marking | Measured | V | ----------+----------- | Xhi | 2.000 | 2.000188 +-----o o----+---+ | 2.000179 | | ----------+----------- --- --- 3.579545 | 3.580152 --- 18p --- 18p ----------+----------- | | 10.000 | 10.003115 V GND V ----------+----------- 12.000 | 12.007229

Reply to
Robert Baer
Loading thread data ...

RTFM. eg section 6 in 16F84. I suspect default is basic RC operation but have never investigated that since I wanted a precision clock rate. In HS mode it will happily drive a suitable 20MHz Xtal.

--
Regards, 
Martin Brown
Reply to
Martin Brown

Many 8 bit PICs default to RC oscillator mode if unprogrammed. Try a

22pF cap to ground and a 5.6K pullup on OSC1. OSC2 generally outputs a Fosc/4 signal in RC mode.

Simply configure the PIC for HS mode and connect a 20MHz crystal across OSC1/OSC2 with load caps to ground of sligtly less than double the parallel load capacitance specified in the crystal's datasheet. External series and shunt resistors are only required in exceptional circumstances. See Microchip Application Notes AN826, AN849 & AN949.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)  
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk  
[at]=@, [dash]=- & [dot]=. *Warning* HTML & >32K emails --> NUL
Reply to
Ian Malcolm

If this is the Schumann calibrator project then the PIC device I think you are referring to is the 16F648 which has an oscillator block capable of several configurations. An unprogrammed config word will be all 1's and will select RC oscillator with fosc/4 output - see datasheet DS40044F page 96 (which your pdf reader may show as page 98).

piglet

Reply to
piglet

If I understand you correctly, you want to know how to modify your circuit so that it produces a frequency no higher than the crystal's marking. Yes?

Reply to
John S

Yes, yes,yes,,,,,the CIRCUIT values please...

Reply to
Robert Baer

To select a given frequency or harmonic, one can put an LC tank in parallel with the crystal, so that non-resonant modes are shorted out. The LC tank itself can also be used, if accuracy inbetween RC and xtal is tolerable.

Dimension the LC for comparable impedance to the crystal, i.e., sqrt(L/C) ~=

1kohm.

Tim

-- Seven Transistor Labs Electrical Engineering Consultation Website:

formatting link

Reply to
Tim Williams

AN826 "No records found" AN849 found; what is a "capasitors" ? due i no how to spel? AN949 found; real English.

Thanks; 2 out of three is pretty good.

Reply to
Robert Baer

EggZactly Korrect! Still, the simple program did not work without the included config, and with ONE exception still does not work. Osc pins now near 2V logic, NO oscillation seen,ever. All "debug" LEDs off (those are via 10K from a pin to ground). Once (if you can count that high...) when probing around, i must ave touched something, because BINK! the LEDs went on. Powered off,then back on. No go; all LEDs off (except pin 4 LED indicating near 2V logic - standard blah blah).

Thanks.

Reply to
Robert Baer

Exactly. A few tens of Hertz more or less is acceptable; i could live with a few hundreds if absolutely necessary. Part value ideas?

Reply to
Robert Baer

Robert Baer wrote in news:xNlIx.11700$ snipped-for-privacy@fx06.iad:

AN826

If you slightly exceed the crystal's specified load capacitance it gurantees that it will be pulled to a frequency slightly lower than its nominal frequency.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)  
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk  
[at]=@, [dash]=- & [dot]=. *Warning* HTML & >32K emails --> NUL
Reply to
Ian Malcolm

Ian Malcolm wrote in news:XnsA511EDE9FEF2C0xDEADBEEF@213.239.209.88:

Corretion: You have to account for its frequency tolerance, so to guarentee its below the nominal frequency, you need to pull it by at least its tolerance. See the section "Crystal Pulling" in AN826.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)  
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk  
[at]=@, [dash]=- & [dot]=. *Warning* HTML & >32K emails --> NUL
Reply to
Ian Malcolm

(snip munged ASCII schematic)

The manufacturer usually specifies the "loading" capacitance that must be used to achieve their target frequency. Note that the 22p and 10p are in series across the crystal (the loading). By increasing the capacitance, you might be able to pull the frequency to where you want. First try to increase the 10p. If fails to start and oscillate, then don't do that.

I saw one circuit some years ago that had an inductor in series with the crystal, but can't remember any details.

Just some thoughts

Reply to
John S

By the way, Robert, how do you know that your frequency counter is accurate? Rubidium standard, GPS disciplined, other?

Reply to
John S

Are you incapable of reading a datasheet?

As someone else has pointed out you can pull the crystal frequency down by adding a bit of extra loading capacitance 33pF so that the clock rate is pulled lower by 2-3 sigma according to taste.

Your crystal makers datasheet will probably tell you what series resistor to use to avoid overdriving the Xtal and shortening its life.

I prefer to err on the high side and digitally correct down to get the mean clock rate right averaged over a long period. Bad for phase noise but an easy way of compensating and calibrating out for timekeeping.

The humble 32kHz xtal can be made surprisingly accurate this way with digital trimming to get a second and a day a more or less spot on.

--
Regards, 
Martin Brown
Reply to
Martin Brown

Yes, Farnell have 19.68MHz and 19.6608HMz crystals.

I'm guessing that someone is sending data at a rate in accordance with a specification, and someone else is receiving said data at a maximum rate as specified. No slack when the TX uC clock is slightly faster than the RX uC clock and so you lose data.

Got the T-shirt, but the fix was easy - the RX guy just removed his artificial limit on RX rate which was a product of software engineering naivety.

Cheers

--
Syd
Reply to
Syd Rumpo

That's usually a bad idea. A crystal looks capacitive everyplace except between its series and parallel resonances, which is a huge help in making sure it wakes up at the right frequency.

An inductor in _parallel_ can help when you're building overtone oscillators, to cancel the otherwise-dominant parallel capacitance.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs 
Principal Consultant 
ElectroOptical Innovations LLC 
Optics, Electro-optics, Photonics, Analog Electronics 

160 North State Road #203 
Briarcliff Manor NY 10510 

hobbs at electrooptical dot net 
http://electrooptical.net
Reply to
Phil Hobbs

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.