Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PIC]: PIC oscillator

0 views
Skip to first unread message

Jinx

unread,
Feb 16, 2002, 12:51:22 AM2/16/02
to PIC...@mitvma.spammers.are.scum.mit.edu
Does anyone know the internal structure of a PIC's oscillator
section ? I'm trying to sort out a circuit that can have a crystal
and a pair of caps plugged in that doesn't require tuning, and
works over the range of 4-20MHz. I've tried both of the circuits
suggested by MC for parallel/series crystals but so far neither
is flexible enough or needs fiddling with over the full range of
crystals that a PIC (or indeed any other micro) will accept

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


Sirish

unread,
Feb 16, 2002, 1:08:20 AM2/16/02
to PIC...@mitvma.counterspam.mit.edu
On Saturday 16 February 2002 00:51, you wrote:
> Does anyone know the internal structure of a PIC's oscillator
> section ? I'm trying to sort out a circuit that can have a crystal
> and a pair of caps plugged in that doesn't require tuning, and
> works over the range of 4-20MHz. I've tried both of the circuits
> suggested by MC for parallel/series crystals but so far neither
> is flexible enough or needs fiddling with over the full range of
> crystals that a PIC (or indeed any other micro) will accept

i think your problem may be in the Oscillator mode in the CONFIG register.
With _XT_OSC, i have been able to use crystals upto 12MHz. The 16 MHz crystal
needed the _HS_OSC to work.

I am not sure, but most likely this is the problem.

Any Comments? others ?

--
Sirish.K.A
DeepRoot Linux Pvt. Ltd.
Yelahanka
Bangalore -560064
Karnataka
India
Ph : +91(80)8565624

Graeme Zimmer

unread,
Feb 16, 2002, 1:25:17 AM2/16/02
to PIC...@mitvma.no.spam.mit.edu
----- Original Message -----
From: "Jinx" <joeco...@CLEAR.NoThiS.NET.NZ>
To: <PIC...@MITVMA.Bogus.MIT.EDU>
Sent: Saturday, February 16, 2002 4:51 PM
Subject: [PIC]: PIC oscillator


> I'm trying to sort out a circuit that can have a crystal
> and a pair of caps plugged in that doesn't require tuning

Jinx, I've never had the standard "Pye" type circuit NOT work,
as long as normal cut Xtals were used.

I would think that it is more a matter of avoiding weird Xtals.

What problems do you notice?

..................... Zim

Steve Baldwin

unread,
Feb 16, 2002, 1:55:07 AM2/16/02
to PIC...@mitvma.cut.mit.edu
> Does anyone know the internal structure of a PIC's oscillator
> section ? I'm trying to sort out a circuit that can have a crystal and

> a pair of caps plugged in that doesn't require tuning, and works over
> the range of 4-20MHz. I've tried both of the circuits suggested by MC
> for parallel/series crystals but so far neither is flexible enough or
> needs fiddling with over the full range of crystals that a PIC (or
> indeed any other micro) will accept

If you can afford the frequency tolerance, it might be a good time to
look at your new found friend, the ceramic resonator. Layout for a 3
terminal version and plug in whichever frequency you need. They
are more forgiving to stray everythings than a crystal circuit.

Steve.

======================================================
Steve Baldwin Electronic Product Design
TLA Microsystems Ltd Microcontroller Specialists
PO Box 15-680, New Lynn http://www.tla.co.nz
Auckland, New Zealand ph +64 9 820-2221
email: ste...@tla.RemovE.co.nz fax +64 9 820-1929
======================================================

Jinx

unread,
Feb 16, 2002, 5:34:11 AM2/16/02
to PIC...@mitvma.cut.mit.edu
> Jinx, I've never had the standard "Pye" type circuit NOT work,
> as long as normal cut Xtals were used.

> I would think that it is more a matter of avoiding weird Xtals.

> What problems do you notice?

> ..................... Zim

The immediate need is for a 3.6864MHz clock source that
can drive upwards of 6 PICs for an RS232 system. I'm not
aware of a resonator < 4MHz that could be used for 0%
comms unfortunately. There's a 7.37MHz though (2 x 3.685,
= 3.6864 x 0.9996)

(One option, just to keep things simple, if defeatist, would be
to run one PIC at 14.7456MHz and use Clkout = osc/4 for
the others)

The crystal is a Fox0368S. Maybe the S is for series ? I've
got Fox 10MHz crystals here that I use with the PICs and
they aren't marked with a P (unlike the back of our couch,
damn cat) so perhaps the S is meaningless in this context

In front of me now I have a Pierce circuit. A 3.6864 crystal in
parallel with an LS04 gate, 2 x 22p to ground, 470R across
the crystal (originally a 330k pot), like this one

http://vlsi.wpi.edu/webcourse/ch05/ch05.html

oscillating at 0.4V with a very nice 48MHz sine wave.

[update while off-line]

However, after re-reading the text with the text the link below
I've changed that to an HC and the o/p is now 11.092MHz (3rd
harmonic) at 4.5V, so that's an improvement. By changing the
feedback resistor to 4k7 in series with a 100k pot I can tune
the circuit to o/p the required 3.6864MHz. Grounding the crystal
case helps a lot. But it doesn't take much for the waveform
and frequency to go nutso, and it doesn't start reliably

Now, this one here (bottom of page in black), uses a series
resistor as a filter

http://www.gaby.de/z80/uexosc.htm

but I don't know what calculation he's using to work out the
value of the resistor. Some 1/ sqr rt pi rfc I guess

The others on that page look like the examples in the PIC
manual. The parallel one is what I tried first. But as you read
in my original request, you don't have to twiddle with pots on
a PIC. The best so far is the series circuit. With 470R feedback
resistors, no caps and an HC00, it will start reliably with either
a 3.6864MHz or a 9.8304MHz crystal, at good voltage and
wave quality

What I don't understand is that these are parallel cut crystals,
the type I use all the time with micros (which require parallel
cut), yet the series circuit seems to work so much better

Dave Dilatush

unread,
Feb 16, 2002, 6:55:19 AM2/16/02
to PIC...@mitvma.antispam.mit.edu
Jinx wrote...

>What I don't understand is that these are parallel cut crystals,
>the type I use all the time with micros (which require parallel
>cut), yet the series circuit seems to work so much better

I'm no expert on crystal oscillators; so I could be wrong here. But
AFAIK there isn't anything structurally different between "parallel"
resonant and "series" resonant crystals; all crystals have parallel and
series resonant frequencies, as I understand it, and a particular unit
is defined as parallel or series simply because that's the resonant mode
that'll give you the frequency that's marked on the can.

Either mode will "work" but only the mode specified will give the right
frequency. The series mode resonance and parallel mode resonant
frequencies may be very close together. I think.

In any case, there's a good application note at Fairchild, "HCMOS
Crystal Oscillators", at

http://www.fairchildsemi.com/an/AN/AN-340.pdf

which might be worth a read.

Need more coffee...

Cheers,

Dave

Jinx

unread,
Feb 16, 2002, 7:09:42 AM2/16/02
to PIC...@mitvma.cut.mit.edu
> http://www.fairchildsemi.com/an/AN/AN-340.pdf

Despite their attempts, I'm afraid it's still all a bit of a black
art. The drivers in micros must be more complex than these
parallel circuits, the type I've found so flakey. Do micros have
AGC or some detector in them so they will operate over a
wide range of frequencies ? For example, what is switched
in/out when the micro is set to LP, XT or HS ?

Clint O'Connor

unread,
Feb 16, 2002, 7:23:02 AM2/16/02
to
The same crystal circuit should work for all frequencies, e.g. crystal tied
to OSC1 and OSC2 with a 20pf or so cap from each leg to ground. Microchip
shows a 1M resistor across the cap though I've never used one in the past.
You need to check your oscillator voltage at OSC OUT, at the higher
frequencies, it may dip low enough that you have to change from XT to HS
tuning. HS provides more drive for the oscillator.

Clint

"Jinx" <joeco...@CLEAR.Extra.NET.NZ> wrote in message
news:000701c1b6ad$fd0141c0$029fa7cb@joe...

Dave Dilatush

unread,
Feb 16, 2002, 7:24:55 AM2/16/02
to PIC...@mitvma.counterspam.mit.edu
Jinx wrote...

>> http://www.fairchildsemi.com/an/AN/AN-340.pdf
>
>Despite their attempts, I'm afraid it's still all a bit of a black
>art. The drivers in micros must be more complex than these
>parallel circuits, the type I've found so flakey. Do micros have
>AGC or some detector in them so they will operate over a
>wide range of frequencies ? For example, what is switched
>in/out when the micro is set to LP, XT or HS ?

Alas, it is indeed a black art. I don't know what's being switched in
the PICs between LP, XT, and HS, but Intersil has a CMOS crystal
oscillator chip, the HA7210, that has a pair of frequency range select
inputs which change the internal biasing on the internal amplifier to
optimize its transconductance and power dissipation depending on the
operating frequency. Perhaps PICs are similar? (BTW, the HA7210 was
the first thing I thought of in response to your original question; but
it's only guaranteed to work up to 10 MHz.)

More coffee...

Dave

Jinx

unread,
Feb 16, 2002, 7:33:11 AM2/16/02
to PIC...@mitvma.spammers.are.scum.mit.edu
> (BTW, the HA7210 was the first thing I thought of in
> response to your original question; but it's only
> guaranteed to work up to 10 MHz.)

I use it occassionally as a 32kHz buffer

> More coffee...

Oscillators have done me in for today

SLEEP SLEEP
GOTO SLEEP

Dave Dilatush

unread,
Feb 16, 2002, 7:46:01 AM2/16/02
to PIC...@mitvma.no.spam.mit.edu
Jinx wrote...

>Oscillators have done me in for today
>
>SLEEP SLEEP
>GOTO SLEEP

Nitey nite...

Meanwhile, I'll try to think of something.

Dave

Jinx

unread,
Feb 16, 2002, 7:56:39 AM2/16/02
to PIC...@mitvma.remove.mit.edu
> Nitey nite...

> Meanwhile, I'll try to think of something.

Cheers. If you suggest a circuit, don't forget to give it
a lewd name

(Benny Hill is not dead - he's Elvis' chaffeur)

0 new messages