Searching \ for 'Crystal Tutorial' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=crystal+tutorial
Search entire site for: 'Crystal Tutorial'.

Truncated match.
PICList Thread
'Crystal Tutorial'
1998\10\15@185037 by Richard A. Smith

flavicon
face
I know this is probally a FAQ but my early web searches have left me unsatisfied
.

Reciently we had a uC that had oscillator startup problems.  Our vendor substitu
ed a crystal that was suposssed to be a
replacement.  Yeah right.  In going over the datasheets though it became apparen
t that none of us here really had solid
knowledge of why we were using values we were using in the oscillator circuit.

Checked some app notes and got the problem solved but I am still a little in the
dark on why.  Anybody have some pointers to a
good tutorial or app notes on designing a osc circuit that starts robustly?  I w
ant things explained like what kind of caps are good
for load caps and why and what to look for in a mfg spec sheet if a vendor sugge
sts an alternate crystal because the one you
ususally use is back ordered until the end of time.

Thanks.

--
Richard A. Smith                         Bitworks, Inc.
spam_OUTrsmithTakeThisOuTspambitworks.com               501.521.3908
Sr. Design Engineer        http://www.bitworks.com

1998\10\16@082156 by Peter L. Peres

picon face
> starts robustly

imvvho there is no *parallel* resonant crystal circuit that starts
robustly without being on the verge of over-driving the crystal.

A series resonant crystal almost never has this problem. For which reason
I shamelessly and consistently remove both pi load caps and place a r=1M5
resistor in parallel with the crystal on nearly all things I do with PICs.
I have not used this above 6 MHz but 3.57-6MHz always works for me.

Notice that the crystal will resonate on the series frequency, which is a
little bit off the parallel one. This has some timing implications, if
doing timekeeping etc.

I have no direct figures, but I think that the RFI emitted by the circuit
wired like this goes down vs. with pi caps.

It is worth a serious try imho.

Peter

1998\10\16@115640 by Dave VanHorn

flavicon
face
>imvvho there is no *parallel* resonant crystal circuit that starts
>robustly without being on the verge of over-driving the crystal.


How do you come to that conclusion?

>A series resonant crystal almost never has this problem. For which
reason
>I shamelessly and consistently remove both pi load caps and place a
r=1M5
>resistor in parallel with the crystal on nearly all things I do with
PICs.
>I have not used this above 6 MHz but 3.57-6MHz always works for me.




>Notice that the crystal will resonate on the series frequency, which
is a
>little bit off the parallel one. This has some timing implications,
if
>doing timekeeping etc.

Why not use series resonant rocks then, and avoid the problem
entirely?


>I have no direct figures, but I think that the RFI emitted by the
circuit
>wired like this goes down vs. with pi caps.


This makes sense to me, I have always wondered about the cap on  the
output pin myself. That looks like a good way to get the chip to draw
a lot of current at the harmonics, and a great opportunity to sink
noise into the ground.

1998\10\16@121702 by Peter L. Peres

picon face
On Fri, 16 Oct 1998, Dave VanHorn wrote:

> >imvvho there is no *parallel* resonant crystal circuit that starts
> >robustly without being on the verge of over-driving the crystal.
>
> How do you come to that conclusion?

By observation of many gazillions of cases, and by having spent the last
~8 years in maintenance/repair of hi-tech stuff (esp. cameras and
electro-optical devices). I've yet to see a series crystal circuit failed
by old age, drift, dirt, even immersion in water and some corrosion. The
low impedance in the circuit makes it imprevious to almost everything. Ok,
it draws slightly more current, so it has some lmiits. But for all these
advantages ;)

> >Notice that the crystal will resonate on the series frequency, which
> is a
> >little bit off the parallel one. This has some timing implications,
> if
> >doing timekeeping etc.
>
> Why not use series resonant rocks then, and avoid the problem
> entirely?

Because for some reason people have decreed that parallel is the most
popular way, and series crystals are hard to get in small quantities. I
would not be surprised if this 'policy' dates back to valve days when it
used to be difficult to drive a series rock properly with economical
hardware.

BTW, the fact that there are 'series' and 'parallel' crystals is a part of
an academic dispute in the case of PICs where all it has to do, is sing
loud ;)

So, almost any parallel rock IS a series rock for PIC purposes until
proven otherwise. Ok, the frequency will be off by ~100-500 Hz for 10 MHz
but I guess the average servo loop controller and LED blinker couldn't
care less.

> >I have no direct figures, but I think that the RFI emitted by the
> circuit
> >wired like this goes down vs. with pi caps.
>
> This makes sense to me, I have always wondered about the cap on  the
> output pin myself. That looks like a good way to get the chip to draw
> a lot of current at the harmonics, and a great opportunity to sink
> noise into the ground.

Yes. Using that configuration without a series resistor is a design sin ;)
BTW, the books say clearly that there HAS to be a resistor there to match
the low Z of the amplifier to the pi input. Somewhere along the way, it
got rationalized away from 'standard' schematics. It took more stringent
RFI requirements to make people remember ;) Needless to say, there is
nothing about this in microprocessor books, try a RF book about crystal
filters instead ;)

Peter

1998\10\16@124748 by Dave VanHorn

flavicon
face
>By observation of many gazillions of cases, and by having spent the
last
>~8 years in maintenance/repair of hi-tech stuff (esp. cameras and
>electro-optical devices). I've yet to see a series crystal circuit
failed
>by old age, drift, dirt, even immersion in water and some corrosion.
The
>low impedance in the circuit makes it imprevious to almost
everything. Ok,
>it draws slightly more current, so it has some lmiits. But for all
these
>advantages ;)


Come to think of it, out of 9 years and 5M units in the field (most
with multiple rocks) I don't remember ever replacing a crystal. These
were all paralell mode units. I didn't do all the repairs myself, but
I did a large number of them in the early years, and was intimately
involved with both the manufacturing and repair operations later.
Immersion in Pepsi, Coke, and Coffee is our usual death mix, although
we have had the odd encounter with a 2x4 and some got shot in holdups.

>> Why not use series resonant rocks then, and avoid the problem
>> entirely?
>
>Because for some reason people have decreed that parallel is the most
>popular way, and series crystals are hard to get in small quantities.
I
>would not be surprised if this 'policy' dates back to valve days when
it
>used to be difficult to drive a series rock properly with economical
>hardware.


Digikey carries both for most popular frequencies, and for production,
it dosen't matter at all.

>BTW, the fact that there are 'series' and 'parallel' crystals is a
part of
>an academic dispute in the case of PICs where all it has to do, is
sing
>loud ;)


No dispute by me, all rocks got paralell and series resonant points,
it's just that the material is cut to enhance a specific mode, and the
behaviour is only guaranteed around one point. You don't even get a
guarantee that a paralell mode xtal will even start in series mode.
This may explain the crystal problems that seem to haunt people.  I've
never had a problem, but I'm always careful to put the right rock in
the right application.

>So, almost any parallel rock IS a series rock for PIC purposes until
>proven otherwise. Ok, the frequency will be off by ~100-500 Hz for 10
MHz
>but I guess the average servo loop controller and LED blinker
couldn't
>care less.


For the hobbyist, I agree, but in commercial products, that's
hairy-scary indeed!


>Yes. Using that configuration without a series resistor is a design
sin ;)
>BTW, the books say clearly that there HAS to be a resistor there to
match
>the low Z of the amplifier to the pi input. Somewhere along the way,
it
>got rationalized away from 'standard' schematics. It took more
stringent
>RFI requirements to make people remember ;) Needless to say, there is
>nothing about this in microprocessor books, try a RF book about
crystal
>filters instead ;)


That makes sense.  I think mostly, this stems from IC designers using
"cookbook" sections for the oscillator. The actual design information
appears to have been lost in the mists of time, all they know now is
"it works", and they don't give any information at all in most
datasheets, on the circuit that is driving the crystal. Fortunately,
crystals are fairly forgiving, and will TRY to sing the right tune if
you give them half a chance :)

1998\10\16@135522 by Reginald Neale

flavicon
face
>
>Yes. Using that configuration without a series resistor is a design sin ;)
>BTW, the books say clearly that there HAS to be a resistor there to match
>the low Z of the amplifier to the pi input. Somewhere along the way, it
>got rationalized away from 'standard' schematics. It took more stringent
>RFI requirements to make people remember ;) Needless to say, there is
>nothing about this in microprocessor books, try a RF book about crystal
>filters instead ;)
>

But I think he was talking about a PARALLEL resistor, the purpose of which,
AFAIK, is to guarantee that there is positive feedback from the output of
the OSC circuit back to the input. I use resonators with built-in caps;
always use the parallel resistor and never use the series resistor.

Reg Neale

1998\10\16@144559 by Dave VanHorn

flavicon
face
>>Yes. Using that configuration without a series resistor is a design
sin ;)

>
>But I think he was talking about a PARALLEL resistor, the purpose of
which,
>AFAIK, is to guarantee that there is positive feedback from the
output of
>the OSC circuit back to the input. I use resonators with built-in
caps;
>always use the parallel resistor and never use the series resistor.
>
>Reg Neale

Nope, he had me right.. The output from the chip has hard edges on it,
and the effect of that output side cap to ground is to make the chip
draw lots of current during those transitions to charge and discharge
the cap. The driver has some internal resistance, so it's not
horrible, but it was never clear to me wether that cap was necessary.
It is clearly an EMI hazard.  If you insert a series R, between the
driver output and the cap, then you put a further limit on the current
into the cap. You also add phase shift, which may or may not be a
problem..

Stable Datum: If the rock don't sing the right tune, then the
circuit's not right yet. (for that type of rock)
Crystals are very accurate, so if it's noticeably off, then you're
doing something wrong.  The implications of that are that it may
continue to work, or it may never start up again, or it may be
intermittent, or it may suddenly try to jump to a harmonic.

1998\10\16@145410 by Peter L. Peres

picon face
On Fri, 16 Oct 1998, Reginald Neale wrote:

> >
> >Yes. Using that configuration without a series resistor is a design sin ;)
> >BTW, the books say clearly that there HAS to be a resistor there to match
> >the low Z of the amplifier to the pi input. Somewhere along the way, it
> >got rationalized away from 'standard' schematics. It took more stringent
> >RFI requirements to make people remember ;) Needless to say, there is
> >nothing about this in microprocessor books, try a RF book about crystal
> >filters instead ;)
> >
>
> But I think he was talking about a PARALLEL resistor, the purpose of which,
> AFAIK, is to guarantee that there is positive feedback from the output of
> the OSC circuit back to the input.

I was the guy who was talking about a parallel resistor, instead of the
two caps, and of relatively low value. In this case, its role is to
destroy the Q of the crystal when parallel resonating such that the series
mode will be dominant.

> I use resonators with built-in caps;
> always use the parallel resistor and never use the series resistor.

I don't think that ceramic resonators apply for this, because they use a
different principle of operation, and do not have a series mode at all (or
rather, they better not have one). Also I think that the parallel resistor
is not needed at all for this, especially with a PIC, that lready has
such an apparatus internally.

BTW I've also used the series method with parallel R on other chips, such
as NS16550A at 8 MHz. It always seems to work for me ;)

Peter

1998\10\16@154357 by William Chops Westfield

face picon face
   > This makes sense to me, I have always wondered about the cap on  the
   > output pin myself. That looks like a good way to get the chip to draw
   > a lot of current at the harmonics, and a great opportunity to sink
   > noise into the ground.

   Yes. Using that configuration without a series resistor is a design sin ;)
   BTW, the books say clearly that there HAS to be a resistor there to match
   the low Z of the amplifier to the pi input. Somewhere along the way, it
   got rationalized away from 'standard' schematic.s

Surely it is inside the chip?  Adding a resistor inside a chip is simple,
compared to adding a cap...

BillW

1998\10\16@171939 by Reginald Neale

flavicon
face
>I don't think that ceramic resonators apply for this, because they use a
>different principle of operation, and do not have a series mode at all (or
>rather, they better not have one). Also I think that the parallel resistor
>is not needed at all for this, especially with a PIC, that lready has
>such an apparatus internally.
>

Yep, you're right; now I seem to remember that in PICs, this is what the
RC/XT/HF config bits do, they set the value of this parallel resistor.

Reg

1998\10\16@174247 by Harrison Cooper

flavicon
face
I believe I have a fundamentals of crystal osc tutorial, taken from the
pages of RF Design, but since I moved offices, most of those are buried.
I'll try to find it and scan if anyone is interested

1998\10\16@231229 by jamesp

picon face
I would like a copy of the tutorial if you can find it.  Thanks and
regards,   Jim

----------
> From: Harrison Cooper <.....hcooperKILLspamspam@spam@ES.COM>
> To: PICLISTspamKILLspamMITVMA.MIT.EDU
> Subject: Re: Crystal Tutorial
> Date: Friday, October 16, 1998 4:41 PM
>
> I believe I have a fundamentals of crystal osc tutorial, taken from the
> pages of RF Design, but since I moved offices, most of those are buried.
> I'll try to find it and scan if anyone is interested

1998\10\17@071335 by steve

flavicon
face
You guys are starting to get way off target here. Removing the caps
from your circuit doesn't make it series resonant. The resistor
across the amplifier terminals is selected so that it has minimal
effect on the crystal parameters while still biasing the amp. A
ceramic resonator works in the same way as a crystal, has parallel &
series resonant points, but all parameters are much looser than a
quartz crystal.

Back to this parallel series thing. At the series resonant point, the
L & C components of the crystal cancel, leaving just the R. This is
the same as a series RLC circuit you build out of an R, L and C
(hence the name). The remaining resistive component has no phase
shift (just like a resistor). So at the series resonant frequency,
what comes out of the crystal is the same phase as what went in.

At parallel resonance the inductive component of the crystal forms a
parallel resonant circuit with its own Cp (the plating on the
electrodes) in parallel with the two caps on the outside and the
amplifier (effective) capacitance. At this point what comes out of
the crystal (circuit) is 180 degrees phase shifted from what goes in.

In order to make an oscillator you need a total of 360
degrees phase shift. The inverting amp gives you 180 degrees and a
parallel resonant crystal gives you another 180 degrees.

To use a crystal at the series resonant point you must provide an
amplifier with the 360 degree phase shift needed. The faster you go,
the harder this gets because any time taken to get around the circuit
equates to a phase shift.

The crystal has inductive properties of 100's of Henries so
if you just consider that as an L and add the two capacitors, it
isn't a far leap to the frequency selection section of a Colpitts
oscillator.

If you don't fit the external capacitors you are still left with the
internal capacitance plus the amplifier capacitance. ie a parallel
resonant circuit but at a different load capacitance.

Steve.

{Quote hidden}

======================================================
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: .....stevebKILLspamspam.....tla.co.nz      fax +64 9 820-1929
======================================================

1998\10\17@090257 by Peter L. Peres

picon face
On Fri, 16 Oct 1998, William Chops Westfield wrote:

> I once wrote:
>     Yes. Using that configuration without a series resistor is a design sin ;)
>     BTW, the books say clearly that there HAS to be a resistor there to match
>     the low Z of the amplifier to the pi input. Somewhere along the way, it
>     got rationalized away from 'standard' schematic.s
>
> Surely it is inside the chip?  Adding a resistor inside a chip is simple,
> compared to adding a cap...

 Adding a resistor at that point inside the chip adds stray capacitance
on the highest frequency clock line in the chip, extra power drain on the
gate that drives it, consumes die space, and can't be optimal as the R has
to match the actual pi. As far as I know, the only R in the clock output
is the RdsON of the respective MOS transistor, and you can't really use
that as you'd attenuate the on-chip signal. Besider, if the R would be
there, how could one destroy a crystal by over-driving it with a PIC ? ;)
Anyway bare CMOS oscillators are a hack. Fortunately, it mostly works ;)

 FYI most analog chips with crystal oscillators NEVER drive the crystal
rail-to-rail for several reasons. An example are color demodulators for TV
and VCR use where the signal on the crystal is often in the 300 mVpp range
at Vcc=9..12V. The stability and purity of these can be 3 orders of
magnitude better than a bare CMOS oscillator. F.ex. a PAL decoder's
crystal is locked to within +/- 1Hz or better to the transmitter's burst
and has a short-term drift (over 60 usec) about ten times lower (0.1Hz).
That's better than 0.03 ppm short term at 4.433619 MHz. Any drift beyond
that produces colored 'curtains' or shading in the image.

Peter

1998\10\17@090300 by Peter L. Peres

picon face
On Sun, 18 Oct 1998, Steve Baldwin wrote:

> You guys are starting to get way off target here. Removing the caps
> from your circuit doesn't make it series resonant. The resistor
> across the amplifier terminals is selected so that it has minimal
> effect on the crystal parameters while still biasing the amp. A
> ceramic resonator works in the same way as a crystal, has parallel &
> series resonant points, but all parameters are much looser than a
> quartz crystal.

I always thought a ceramic resonator works on the SAW principle (or
compression wave) using a disturbance structure to set the frequency.

- snip -

> To use a crystal at the series resonant point you must provide an
> amplifier with the 360 degree phase shift needed. The faster you go,
> the harder this gets because any time taken to get around the circuit
> equates to a phase shift.

This is correct, but it somehow works for me. It is possible that there is
enough phase shift in the oscillator and stray capacitances to allow
enough gain nevertheless. And the 1M5 resistor I usually use for this is
too low to allow parallel mode imho. I went down to 220K without stopping
the oscillation with this, at 5V, with PIC16C54XT and JW in XT mode. The
pi caps were connected when I went down to 220K.

BTW the other commonly used two-inverter oscillator (LS, HC, CMOS etc) is
a series oscillating one too. This is one of the more robust and
un-demanding simple oscillators that exist. I mean:

  R1
+-/\/\/\-+
|        |
|  |\    |  |\
+--+ O---+--+ O--+--O Out
|  |/       |/   |
|                |
+-|X|-/\/\/\--||-+

 Xtal  R2    C1

there is another variation with feedback on the second gate.

Peter

1998\10\17@234018 by steve

flavicon
face
> I always thought a ceramic resonator works on the SAW principle (or
> compression wave) using a disturbance structure to set the frequency.

As does a crystal. They are both mechanical resonance devices. The
RLC "components" are analogous (?) to the mechanical properties
damping, mass and compliance.

> > To use a crystal at the series resonant point you must provide an
> > amplifier with the 360 degree phase shift needed.
>
> This is correct, but it somehow works for me. It is possible that there is
> enough phase shift in the oscillator and stray capacitances to allow
> enough gain nevertheless.

[.. quote rearranged]

> BTW the other commonly used two-inverter oscillator (LS, HC, CMOS
> etc) is a series oscillating one too.

What seems to work for you ? Earlier you were talking of leaving off
the capacitors on a PIC oscillator. Now you refer to two-inverter
oscillators. One inverter = parallel mode, Two = series mode.

> And the 1M5 resistor I usually use for this is
> too low to allow parallel mode imho. I went down to 220K without
> stopping the oscillation with this, at 5V, with PIC16C54XT and JW in
> XT mode. The pi caps were connected when I went down to 220K.

A typical crystal has an ESR at resonance of <100 ohms. The influence
of the feedback resistor is minimal once oscillation has started so
it can actually be quite low. Startup is a different situation and
the resistor needs to be high enough that the first signs of life
from the crystal will overdrive the signal from the resistor.

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: EraseMEstevebspam_OUTspamTakeThisOuTtla.co.nz      fax +64 9 820-1929
======================================================

1998\10\18@124621 by Peter L. Peres

picon face
On Sun, 18 Oct 1998, Steve Baldwin wrote:

> Me:
> > I always thought a ceramic resonator works on the SAW principle (or
> > compression wave) using a disturbance structure to set the frequency.
>
> As does a crystal. They are both mechanical resonance devices. The
> RLC "components" are analogous (?) to the mechanical properties
> damping, mass and compliance.

? I understand that a ceramic resonator works by channeling a wave through
a (simple) structure. The wave channel properties and not the terminals
determine the frequency. Thus there is no such thing as a (three terminal)
ceramic resonator in series mode. Am I way off or are my books too old ?
Of course there is a mechanical equivalent to it. I think that the ceramic
resonator is modeled as a weakly coupled (on both sides) pendulum or such.

> What seems to work for you ? Earlier you were talking of leaving off
> the capacitors on a PIC oscillator. Now you refer to two-inverter
> oscillators. One inverter = parallel mode, Two = series mode.

What seems to work for me is:
1) PIC16C54 and NS16550A with 4MHz, resp. 8MHz, no caps, and a 1M5
resistor in series with the crystal. The crystal was about 2.5 cm away
from the chip in both cases.
2) Trials with R down to 220K on PIC16C54 with 4MHz, with specced pi caps,
at which point (220K) it stopped starting reliably. 1M was the lowest R
that made it work without caps at all. The PIC was a JW in XT mode every
time.

I guess, all you have to do, is try it out. Leave the caps out when
populating the board on the next project and find out ;)

> A typical crystal has an ESR at resonance of <100 ohms. The influence
> of the feedback resistor is minimal once oscillation has started so
> it can actually be quite low. Startup is a different situation and
> the resistor needs to be high enough that the first signs of life
> from the crystal will overdrive the signal from the resistor.

I always thought that the device with the highest noise at the input of
the oscillator starts the show (the MOS transistors probably). Anyway, an
ESR or 100 ohms is an Equivalent >Series< Resistance. This, and the
extremely high impedance of a parallel resonating crystal make me believe
that putting the resistor there puts the crystal in series mode somehow.

Peter

PS: This thing is exclusively trial stuff. I did not produce any large
numbers of anything using this method. BUT I have to add that older micros
in equipment which develop crystal start-up problems seem to benefit from
the same modification (without removing the original pi caps).

1998\10\18@125236 by Cumhur Kizilari

flavicon
face
Peter L. Peres wrote:
{Quote hidden}

the same modification (without removing the original pi caps).

1998\10\18@131144 by Peter L. Peres

picon face
On Wed, 21 Oct 1998, Cumhur Kizilari wrote:

> Peter L. Peres wrote:
> >
> > On Sun, 18 Oct 1998, Steve Baldwin wrote:
> >
> > > Me:
> > > > I always thought a ceramic resonator works on the SAW principle (or
- snipped more -

 How nice to tell me it made it to the list. Thanks, but no need to
bother next time, as I have turned confirmations on. Have you ?

regards,

Peter

1998\10\19@075239 by Harrison Cooper

flavicon
face
I scanned the document....then looked at the size.  22M.   So....I will
rescan at a lower res (but readable), and send as soon as I can....

If I get enough personal replies, I'll just put on the web someplace for
download.  Those who want it, reply to my email address hcooperspamspam_OUTes.com,
subject of PDF request, so I can keep them seperate.

1998\10\20@130344 by John Payson

flavicon
face
>>
In order to make an oscillator you need a total of 360
degrees phase shift. The inverting amp gives you 180 degrees and a
parallel resonant crystal gives you another 180 degrees.

To use a crystal at the series resonant point you must provide an
amplifier with the 360 degree phase shift needed. The faster you go,
the harder this gets because any time taken to get around the circuit
equates to a phase shift.
<<

I understand that the PIC's oscillator circuit is basically a single
inverter and consequently it will produce about 180 degrees of phase
shift.  Whatever stuff lurks outside it must produce another 180 degs
of phase shift.

I'm still a bit confused, though, about the exact function of the two
load capacitors.  It would seem that the cap on the PIC's output is
there to load down the PIC enough to prevent it swinging rail-to-rail.
Is that what it does?  Would adding a small L between the PIC and that
cap help reduce EMI emissions by cutting peak current spikes, or is an
R better?  If an L is good should it be selected so that LC ~= the des-
ired oscillator rate, or is it somewhat arbitrary?

Also, another thing I was wondering: what (if anything) prevents both
sides of the crystal from simply sitting at about half-rail with no
oscillation?  Is the idea that the load capacitors will start off at
ground so one end of the crystal will be raised to half-rail first
(thus starting an oscillation)?  In case of reset (either /MClr or via
WDT) does the PIC force one or both ends of the crystal to ground
briefly to give it a "kick"?  That would seem like it should improve
startup reliability considerably.

Also, a common trick people have used (esp. with handwired PIC circuits)
is to tie the crystal load caps to VDD instead of ground.  What are the
startup and EMI implications of this, if any?  It would seem like the
initial "kick" the crystal would receive on startup would be the oppo-
site polarity from normal, but such circuits certainly seem to work in
practice and I don't see any reason why the polarity of the first kick
should matter.

Finally, I was wondering what are the effective limiations on RC-based
oscillators (other than the PIC's built-in one)?  Obviously a +/-20%
cap isn't going to yield +/-1ppm accuracy, but it would seem like a
relaxation oscillator should be able to run quite nicely, and small caps
that are stable over temperature aren't hard to find.  Has anyone used
such oscillators?  What are the effective limits?

[relaxation oscillator, simplest form: the inverter is a Shmidtt]

    +--/\/\/\---+
    |           |
    |   |\      |
    |   | \     |
    +---|  >O---+---- OUT
    |   | /
    C   |/
    |
    gnd

In preferred implementations, comparators are used in place of the
Shmidt trigger to ensure that the treshholds are consistent.  Note
that if the chip's output's ESR is small relative to the external
resistor and the chip's input capacitance is small relative to the
value of C, circuit frequency is controlled by RC and the switching
threshholds' relation to VDD.  It would thus seem that it should be
possible to make such a circuit quite stable.  Is that in fact the
case?

1998\10\20@132940 by Dave VanHorn

flavicon
face
>I'm still a bit confused, though, about the exact function of the two
>load capacitors.  It would seem that the cap on the PIC's output is
>there to load down the PIC enough to prevent it swinging
rail-to-rail.
>Is that what it does?  Would adding a small L between the PIC and
that
>cap help reduce EMI emissions by cutting peak current spikes, or is
an
>R better?  If an L is good should it be selected so that LC ~= the
des-
>ired oscillator rate, or is it somewhat arbitrary?


The crystal is designed with a certain amount of external capacitance
in mind. The pcb traces that connect it, and the uP chip itself, both
have some value of stray capacitance. That value is also very hard to
control, and could vary if say the chip was socketed in a later
production run.  The added caps provide a large and stable value to
minimize the effects of the uncontrolled portion.

The cap on the output pin is the one I am the most unclear on. It does
seem like a bad idea to me, to drive fast square waves into a cap (ANY
CAP) since you are then demanding that the output sink and source
large currents at very high frequency.

>Also, another thing I was wondering: what (if anything) prevents both
>sides of the crystal from simply sitting at about half-rail with no
>oscillation?

The fact that the circuit is unstable at that point. It literally
cannot remain in that condition for any length of time.

> Is the idea that the load capacitors will start off at
>ground so one end of the crystal will be raised to half-rail first
>(thus starting an oscillation)?  In case of reset (either /MClr or
via
>WDT) does the PIC force one or both ends of the crystal to ground
>briefly to give it a "kick"?  That would seem like it should improve
>startup reliability considerably.

No.


>Also, a common trick people have used (esp. with handwired PIC
circuits)
>is to tie the crystal load caps to VDD instead of ground.  What are
the
>startup and EMI implications of this, if any?  It would seem like the
>initial "kick" the crystal would receive on startup would be the
oppo-
>site polarity from normal, but such circuits certainly seem to work
in
>practice and I don't see any reason why the polarity of the first
kick
>should matter.


This is an interesting idea, but I don't see that it gains you
anything. Theoretically, your power rail should have very low
impedance to ground, so it should be about a wash. In practice, it
probably increases the EMI somewhat, and like tinfoil on rabbit ears,
may have made something work better accidentally once.

>Finally, I was wondering what are the effective limiations on
RC-based
>oscillators (other than the PIC's built-in one)?  Obviously a +/-20%
>cap isn't going to yield +/-1ppm accuracy, but it would seem like a
>relaxation oscillator should be able to run quite nicely, and small
caps
>that are stable over temperature aren't hard to find.  Has anyone
used
>such oscillators?  What are the effective limits?


Just that the C value gets very small, and you end up with the
internal R in the output driver being a significant portion of the
total R, so the higher you go, the less repeatable it is.


>In preferred implementations, comparators are used in place of the
>Shmidt trigger to ensure that the treshholds are consistent.  Note
>that if the chip's output's ESR is small relative to the external
>resistor and the chip's input capacitance is small relative to the
>value of C, circuit frequency is controlled by RC and the switching
>threshholds' relation to VDD.  It would thus seem that it should be
>possible to make such a circuit quite stable.  Is that in fact the
>case?

If you could get nice stable caps cheap, and the chip's thresholds are
stable with temperature and supply variation, and you aren't trying to
go very fast, then yes.
>From a practical point of view the rock does a better job.  Remember,
it is actually resonant, and there is circulating energy in the
mechanical structure, Even if there are irregularities in the drive
current, the xtal will smooth them out mechanically. (Think flywheel)

1998\10\20@153219 by John Payson

flavicon
face
part 0 5108 bytes
|The fact that the circuit is unstable at that point. It literally
|cannot remain in that condition for any length of time.

If I hook a CMOS inverter's output to its input, it just seems to
sit there; is the idea that the oscillator has enough gain that no
matter what state it's in it will want to wobble at its resonant
frequency?

|> Is the idea that the load capacitors will start off at
|>ground so one end of the crystal will be raised to half-rail first
|>(thus starting an oscillation)?  In case of reset (either /MClr or
via
|>WDT) does the PIC force one or both ends of the crystal to ground
|>briefly to give it a "kick"?  That would seem like it should improve
|>startup reliability considerably.

|No.

Actually, this reminds me of something else I was wondering: if
one is trying to design a PIC circuit to use flea-power in low-
voltage standby operation, it would seem that it would be necessary
to keep /MClr high (since if it goes low the clock will start and
current consumption will increase).  Are there any good ways to
rig things so this doesn't happen (I guess by preventing any brown-
out circuitry from resetting the PIC in such case?)

>Also, a common trick people have used (esp. with handwired PIC
circuits)
>is to tie the crystal load caps to VDD instead of ground.  What are
the
>startup and EMI implications of this, if any?  It would seem like the
>initial "kick" the crystal would receive on startup would be the
oppo-
>site polarity from normal, but such circuits certainly seem to work
in
>practice and I don't see any reason why the polarity of the first
kick
>should matter.

|This is an interesting idea, but I don't see that it gains you
|anything. Theoretically, your power rail should have very low
|impedance to ground, so it should be about a wash. In practice, it
|probably increases the EMI somewhat, and like tinfoil on rabbit ears,
|may have made something work better accidentally once.

The intention of tying the load caps to VDD is simply to simplify
the wiring, especially with handwired protos, since the xtal pins
are right next to VDD.  The question was whether this construction
expedient would be likely to cause any other problems, not whether
it would 'improve' anything else.

>In preferred implementations, comparators are used in place of the
>Shmidt trigger to ensure that the treshholds are consistent.  Note
>that if the chip's output's ESR is small relative to the external
>resistor and the chip's input capacitance is small relative to the
>value of C, circuit frequency is controlled by RC and the switching
>threshholds' relation to VDD.  It would thus seem that it should be
>possible to make such a circuit quite stable.  Is that in fact the
>case?

|If you could get nice stable caps cheap, and the chip's thresholds are
|stable with temperature and supply variation, and you aren't trying to
|go very fast, then yes.
|From a practical point of view the rock does a better job.  Remember,
|it is actually resonant, and there is circulating energy in the
|mechanical structure, Even if there are irregularities in the drive
|current, the xtal will smooth them out mechanically. (Think flywheel)

It's certainly true that crystals are more stable and
repeatable than any sort of RC.  In cases where you want
an oscillator to run and keep running for awhile, they're
the way to go.  In some cases, however, it's desirable to
have an oscillator which can be started and stopped much
more quickly.  Two examples of this sort come to mind:

[1] Flea-power systems where the system needs to periodically
   "wake up" to check something, perhaps due to an external
   stimulus.  Crystals take quite awhile to start (about 1ms);
   if the software needs to poll every 18-20ms or so, that
   would mean the system would be running 5% of the time.  An
   RC could start much faster, reducing the amount of wasted
   "on" time.  Note also that if the system awoke due to an in-
   coming RS-232 character, the crystal's startup time would
   make it impossible to get the first byte; with an RC this
   would not have to be a problem.

[2] Sometimes it's necessary to have a clock synchronized to an
   external stimulus.  For example, if one were trying to do a
   simple on-screen display application with the PIC (e.g. just
   showing the time in large digits) it might be useful to have
   the PIC "sleep" when it's waiting for a horizontal sync pulse.
   When the pulse came, the PIC's clock would then start up in a
   reasonably consistent phase relative to the horizontal line,
   allowing a stable-looking display.  While the position of the
   text on the display would change slightly with temperature,
   etc. the timing from one line to the next would be consistent.
   Crystal-based PLL's certainly can be used in this application
   as well, but they can be finicky and may not like "slightly
   nonstandard" video as given off by many video game machines and
   similar devices.





1998\10\20@162402 by Dave VanHorn

flavicon
face
>|The fact that the circuit is unstable at that point. It literally
>|cannot remain in that condition for any length of time.
>
>If I hook a CMOS inverter's output to its input, it just seems to
>sit there; is the idea that the oscillator has enough gain that no
>matter what state it's in it will want to wobble at its resonant
>frequency?


And you're measuring with a.... Meter?
Look at it with a scope.    It should be oscillating, possibly as high
as 30-50Mhz depending on the chip.
Note that tying it's own output back to the input is pushing things
quite a bit. Try a small R.

The gate has gain, and 180 degrees phase shift. (cause it's an
inverter!)
The crystal has loss, and 180 degrees phase shift at resonance.
If gain-loss>1 then it will oscillate.  It's not just the gain, you
have to have the phase shift.
The frequency of oscillaton will be at the point where the total phase
shift = 360 degrees


>The intention of tying the load caps to VDD is simply to simplify
>the wiring, especially with handwired protos, since the xtal pins
>are right next to VDD.  The question was whether this construction
>expedient would be likely to cause any other problems, not whether
>it would 'improve' anything else.


Seems like it would make EMI worse, since the impedance between VDD
and ground will be non-zero, and VDD noise may affect the oscillator,
or the oscillator noise may affect the chip. This would get filed in
my notebook under "bad ideas". The only place those caps should go is
directly back to the ground pin, on a separate track.

>It's certainly true that crystals are more stable and
>repeatable than any sort of RC.  In cases where you want
>an oscillator to run and keep running for awhile, they're
>the way to go.  In some cases, however, it's desirable to
>have an oscillator which can be started and stopped much
>more quickly.  Two examples of this sort come to mind:


That's inherent in the way a crystal works. The "flywheel" analogy
again. They have startup times that are directly proportional to the
energy they are driven with.
Engineering is the art of compromise :)

1998\10\20@164548 by Sean Breheny

face picon face
At 12:28 PM 10/20/98 -0500, you wrote:
>The cap on the output pin is the one I am the most unclear on. It does
>seem like a bad idea to me, to drive fast square waves into a cap (ANY
>CAP) since you are then demanding that the output sink and source
>large currents at very high frequency.

Actually, when I look at the osc. pins on my 16C84 w/ 4MHz xtal and two
caps with a 200MHz scope, I see a very perfect sine wave. The xtal can't
oscilate in a square wave fasion, since its' not resonant at the additional
harmonics needed to cause the square wave shape. I also think that the
inverter is operating in its linear region, thus not swinging from rail to
rail suddenly anyway. My scope sees a 4V p-p sine on my pic.

About the caps, I always though about it like this: the internal inverter
on the chip provides 180 deg of phase shift. The first external cap (on the
output to ground) when combined with the internal resistance of the
inverter, forms an integrator, thereby shifting the phase comming out of
the inverter by -90 deg (now we have 90 deg total phase shift), the current
then excites the crystal, comes out the other side with no additional phase
shift (xtal at resonance looks like a resistor only), then goes into the
second integrator (formed by the second cap and the input impedance of the
inverter), causing -90 deg phase shift, bringing us back to zero deg phase
shift for total loop.

So, if you wanted, I suppose you could add resistance from the output pin
to the cap/xtal junction on the output. This would tend to limit the output
current. For a 22pF cap and a 4V p-p sine wave applied to it, peak current
is only about 1 mA. Considering how short these leads are usually kept, I
think that the radiation resistance will be fractional ohm, yielding a
radiated power in the microwatt region.

Sean


+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
@spam@shb7KILLspamspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\20@170448 by Sean Breheny

face picon face
>Actually, when I look at the osc. pins on my 16C84 w/ 4MHz xtal and two
caps with a 200MHz >scope, I see a very perfect sine wave. The xtal can't
oscilate in a square wave fasion, since >its' not resonant at the
additional harmonics needed to cause the square wave shape. I also >think
that the inverter is operating in its linear region, thus not swinging from
rail to >rail >suddenly anyway. My scope sees a 4V p-p sine on my pic.

One little correction to my own mail:

I actually see a 5V p-p sine wave on one of the osc pins. It is also very
slightly distorted (not flat-topping, rather the slope is a bit incorrect
at around the 1 and 4 volt points). The other pin shows the undistorted 4V p-p

Sean



+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
KILLspamshb7KILLspamspamcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\20@173823 by steve

flavicon
face
I'll give this a shot, but please understand that the reason these
things are hard to understand is that they are even harder to
explain.

> I'm still a bit confused, though, about the exact function of the two
> load capacitors.

If we go back to the dream time, an ideal parallel resonant circuit
is an inductor in parallel with a capacitor. If we change either of
those, the resonant frequency changes. When we look at the equivalent
circuit of a crystal there is an R, L and C in series and then
another C (Cp) across all of them. Both the R and the C are very
small and the L is very big so it is reasonable to consider just that
portion of the circuit as an L. In order to use that L we need to
attach some contacts by plating metal onto the quartz. Since quartz
is an insulator, this makes the capacitor Cp.

As Dave points out, if we just used the L of the crystal and that Cp
value to form our resonant circuit the frequency would be very
dependant on the strays around the board. When we put capacitors on
the outside of the crystal, we are putting them in parallel with Cp
so that they are the dominant capacitive component in the circuit.

Now it gets tricky. We want a circuit that will provide us with
feedback that is 180 degrees out of phase with our amplifier output.
The point that this occurs is in the middle of Cp with respect to the
other end of Cp that is connected to the amplifier input.

That doesn't say it very well at all. I would suggest that you have a
look at a discrete Colpitts oscillator circuit. With all the
components out in the open, it's a bit easier to get your mind around
how the circuit is operating.

If we call the two added capacitors C1 & C2, then from the crystal's
perspective C1 and C2 are in series and connected in parallel with
Cp. This combination is in parallel with the predominant L of the
crystal to form the resonant circuit.

>From the amplifiers perspective, the signal to amplify is the voltage
between one end of the crystal (amp input) and a point half way
between the two crystal terminals (connected to gnd by the two
capacitors).

>  It would seem that the cap on the PIC's output is
> there to load down the PIC enough to prevent it swinging rail-to-rail.
> Is that what it does?

No. See above. The reason it doesn't swing rail to rail is that the
gain of the amp is highest and is linear about the centre point. If
the output starts heading for the rail, the gain is lower so it is a
form of negative feedback that keeps the amp where we want it. If it
did reach the rail it would clip the sine wave which (according to Mr
Fourier) would introduce harmonic components. That would make life
very difficult.

> Would adding a small L between the PIC and that
> cap help reduce EMI emissions by cutting peak current spikes, or is an
> R better?  If an L is good should it be selected so that LC ~= the des-
> ired oscillator rate, or is it somewhat arbitrary?

If you are having EMI concerns the oscillator isn't the thing to play
with. It is a nice (almost pure) sinewave within the smallest loop
area you can make and most importantly, is closed loop so it only
generates as much energy as it consumes. From an EMI viewpoint, the
oscillator itself is a low radiator.
However, all circuit operations within the chip are done at the
crystal rate so that is the frequency that shows up on the spectrum
analyser and guess what gets the blame.

> Also, another thing I was wondering: what (if anything) prevents both
> sides of the crystal from simply sitting at about half-rail with no
> oscillation?

Designers prayers.
In an ideal world it would sit at mid-rail as that is the purpose of
the feedback resistor. When it is at that point the amplifier has has
its maximum gain and we rely on reality helping out. In the real
world you have a power supply that comes up in leaps and bounds and
thermal and other noise sources all being applied to the amplifier.
These are all amplified to the max and starts to excite the crystal.

> Also, a common trick people have used (esp. with handwired PIC circuits)
> is to tie the crystal load caps to VDD instead of ground.  What are the
> startup and EMI implications of this, if any?

When we put all those ceramic caps across the supply (decoupling
each logic chip) we are trying to make the two rails appear to be
connected for high frequency signals. As far as the oscillator
circuit is concerned they are connected together. It's usually done
for layout reasons.

> Finally, I was wondering what are the effective limiations on RC-based
> oscillators (other than the PIC's built-in one)?

> In preferred implementations, comparators are used in place of the
> Shmidt trigger to ensure that the treshholds are consistent.

You've answered your own question. Relaxation oscillators are
threshold sensitive (by comparison). Not just the actual
comparing device but by the nature of the exponential charge curve.
If you have a threshold that is say, several time constants, the
voltage on the cap is almost horizontal as it approaches the
switching point. Any noise will trip it.
If you set a low threshold, you are sensitive to the discharging of
the cap and this can be quite variable with temperature, devices,
etc.

On the other hand they are cheap, simple and reliable and aren't used
often enough (imho). You either need accurate timing (serial comms,
running a clock) or you don't. A user doesn't notice if you take
100ms or 120ms to update a display and the display doesn't care as
long as you have your delays calculated for worst case.

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: RemoveMEstevebTakeThisOuTspamtla.co.nz      fax +64 9 820-1929
======================================================

1998\10\21@112922 by John Payson

flavicon
face
>>
If we go back to the dream time, an ideal parallel resonant circuit
is an inductor in parallel with a capacitor. If we change either of
those, the resonant frequency changes. When we look at the equivalent
circuit of a crystal there is an R, L and C in series and then
another C (Cp) across all of them. Both the R and the C are very
small and the L is very big so it is reasonable to consider just that
portion of the circuit as an L. In order to use that L we need to
attach some contacts by plating metal onto the quartz. Since quartz
is an insulator, this makes the capacitor Cp.
<<

Okay, I think I'm starting to understand this.  Basically the idea
is that you'd like what the inverter is trying to do to its end of
the crystal to match as closely as possible what the crystal wants
to do itself.  If there's a resistor between the inverter's output
and the crystal (and there's always inherent resistance if nothing
else) a properly-tuned crystal circuit should have essentially
identical waveforms on both sides of it.  If the circuit is tuned
too fast or slow, this may be seen by the inverter's output leading
or lagging the crystal's signal.  The crystal will resist being
pulled off-frequency, but the poor tuning will increase power con-
sumption, reduce frequency accuracy, and lead to increased wear on
the crystal.

Do I have sort of the right idea?

<<
On the other hand they are cheap, simple and reliable and aren't used
often enough (imho). You either need accurate timing (serial comms,
running a clock) or you don't. A user doesn't notice if you take
100ms or 120ms to update a display and the display doesn't care as
long as you have your delays calculated for worst case.
>>

Generally, the only RC oscillator setups I've seen with micros
have had a very loose (+/- 20% or so) frequency accuracy.  I
would think, though, that RC oscillators should be able to get
within the 2% or so needed for serial communications while off-
ering instant wake-from-sleep behavior, etc.

Actually, what I think I'd most like in many ways would be a CPU
with a programmable RC oscillator and a 32KHz "watch crystal" for
measuring time and/or calibrating the RC.  In fact, if the micro
had suitably-designed serial hardware it wouldn't be necessary to
program the RC rate (just adjust the baud-rate generator to have
the proper speed relative to the crystal).  Since a lot of the
firmware on battery-powered devices have periods with lots of comp-
utation and periods of none, it would then be possible to have the
CPU sleep whenever it's not needed, without the startup-time penal-
ties associated with crystals or PLL's.

1998\10\21@132346 by Harri Suomalainen

flavicon
face
>>Also, another thing I was wondering: what (if anything) prevents both
>>sides of the crystal from simply sitting at about half-rail with no
>>oscillation?
>
>The fact that the circuit is unstable at that point. It literally
>cannot remain in that condition for any length of time.

A few more words on this one: your oscillator has gain of 1 or more
(else it won't oscillate). So, if there is any noise it will be
amplified by the circuitry. Usually noise is the actual starter
of the oscillator!

Even if the circuit was floating at some voltage any noice would
be amplified (and inverted), fed through the crystal (inverted)
and back to the input. While the total loop overall gain is one
or more circuit oscillates. So, even a floating circuit would
start as soon as noise is induced.

>>Also, a common trick people have used (esp. with handwired PIC
>circuits)
>>is to tie the crystal load caps to VDD instead of ground.  What are
>
>This is an interesting idea, but I don't see that it gains you
>anything.

Probably nothing but a nicer layout perhaps.

>Theoretically, your power rail should have very low
>impedance to ground,

Yap. Theoretically it would be as good to connect caps to the +Vdd.
However, in practical circuits there is a finite impedance. There
is also lots of noise. Power supply might actually be swinging
around a tiny bit and so on.

Now, all the ac signals at the "dirty" (opposite of clean) power
supply would be coupled to the oscillator. The more dirty the PSU
the more noise to the oscillator. Transients are a real thing there
especially with digital circuits.

This might eventually lead to lots of problems. System might even
not work properly at some conditions. I'd definately advice against
this practice!

Usually grounding issues are dealt with. You do (or at least should)
give board grounding some consideration. You have lots of ground planes
there with many designs too. These help to protect from spurious
signal coupling. These make conductors heavier too (lower impedance).
Ground planes make capasitive coupling to the surrounding objects
less severe too.

On the other hand, with power lines you probably consider them lot
less. You probably just add a few decoupling caps here and there
to keep power good enough. Then you're happy. It is still far from
clean!


--
Harri Suomalainen     spamBeGonehabaspamBeGonespamcc.hut.fi

We have phone numbers, why'd we need IP-numbers? - a person in a bus

1998\10\21@134436 by Peter L. Peres

picon face
On Tue, 20 Oct 1998, Dave VanHorn wrote:

> The gate has gain, and 180 degrees phase shift. (cause it's an
> inverter!)
> The crystal has loss, and 180 degrees phase shift at resonance.
> If gain-loss>1 then it will oscillate.  It's not just the gain, you
> have to have the phase shift.
> The frequency of oscillaton will be at the point where the total phase
> shift = 360 degrees

What no-one mentions re: phase shift in oscillators is: The phase shift
need not be exaclty 360 degrees at the beginning. No, I am not
contradicting Barkhausen, I'd just like to point out that extra gain in
the amplifier can compansate for non-360 degree phase shifts. Once started
the oscillator will pull itself onto the center frequency but it will be
easier to tune using a varicap etc. The trick is that a non-360 degree
phase shift corresponds to a 360 degree phase shift plus some gain.  Quite
obviously the frequency will be off by a little. If one draws the 2
opposing vectors on a phase circle and adds one that is at say 210 degrees
(the base ones being at 0 and 180), it is immediately obvious that this
will work if the gain at 0 degrees (the amplifier) is large enough, so its
projection on the 30 degree vector modplus the 210 degree vector equals or
exceeds 0.0

One direct implication is that extra gain in the oscillator amplifier
means phase noise (assuming it stays in the linear area) and/or the
possibility of phase modulation.

And this implies that accurate oscillators must have a gain control loop
in the amplifier.

So I'm still thinking about my 1M5 resistor and what it does assuming that
the oscillator has got plenty of gain left over (it has). It would do 2
things at the same time: 1. reduce the gain of the amplifier and 2.
reduce the Q of the crystal. I don't think that phase shift is an issue
here. But reducing the Q of the crystal should improve start-up time (1M5
does that). More ??

Peter

> Seems like it would make EMI worse, since the impedance between VDD
> and ground will be non-zero, and VDD noise may affect the oscillator,
> or the oscillator noise may affect the chip. This would get filed in
> my notebook under "bad ideas". The only place those caps should go is
> directly back to the ground pin, on a separate track.

imho, this is not so. The internal oscillator is almost symmetrical and it
could not care less if it was referenced to GND or Vcc outside. What
radiates RFI is the wiring beyond the chip itself. So, if some application
has all decouplings near the PIC to Vcc, and a singel decoupler group
between Vcc and GND, it will work. If the total area and length of the
local Vdd line is smaller than that of GND this arrangement would even
benefit RFI emission reduction. The shorter and smaller Vdd trace is the
case for most projects, plus it is normally surrounded by the GND trace,
which is beefy.  Need I say more ?

The method is well-known in sensitive circuits, where it is common to
change the reference rail between input and output, using the ESR of the
decoupling as extra separation. Audio circuits and servos with lots of
switching noise on the GND line come to my mind, as examples.

Peter

1998\10\21@142943 by Dave VanHorn

flavicon
face
> imho, this is not so. The internal oscillator is almost symmetrical and it
> could not care less if it was referenced to GND or Vcc outside. What
> radiates RFI is the wiring beyond the chip itself. So, if some application
> has all decouplings near the PIC to Vcc, and a singel decoupler group
> between Vcc and GND, it will work. If the total area and length of the
> local Vdd line is smaller than that of GND this arrangement would even
> benefit RFI emission reduction. The shorter and smaller Vdd trace is the
> case for most projects, plus it is normally surrounded by the GND trace,
> which is beefy.  Need I say more ?
>

IF VDD and ground were equally quiet, and IF there were zero impedance
between VDD and ground, I'd agree with you. Unfortunately, in any real
design, this can't be the case.  All the chip thresholds are referenced
from ground, not from VDD, and VDD is noisy.  You now place harmonic
energy from the osc out onto the VDD tracks, and take whatever noise is
present on VDD and couple it into the oscillator.

I'm not debating the fact that it may function in some cases, maybe even
in most cases.. I'm saying that I will never do this in a commercial
product, and that if I ever find a subsystem we are buying wired this
way, I will disqualify it.  This is not good practice.  What works on
fred's prototype is fine for fred. I can't knowingly put such bad
practice into my products.

I'll keep on restating this, the <ONLY> place those caps should connect
to, is a dedicated track that goes nowhere but to the uP ground pin.
I've seen products fail part 15 HORRIBLY because of this.


> The method is well-known in sensitive circuits, where it is common to
> change the reference rail between input and output, using the ESR of the
> decoupling as extra separation. Audio circuits and servos with lots of
> switching noise on the GND line come to my mind, as examples.

A whole other venue.  IMHO, they should have controlled the paths of
their return currents better.  One little product I did was particularly
nasty in this regard. A 14 Mhz uP, Switching power supply, chopped 12W
stepper motor, and a magnetic read head with an output of about a
microvolt, all crammed onto a 2 layer board, 3 x 6 inches in a plastic
enclosure.  The read head tracks run paralell to the stepper motor
tracks.

No problems at all. The read head never sees any pickup from the stepper
motor, apart from it's external magneitc field. Passed part 15B, tester
comment: "Is it on?" Maximum peaks were 20dB below the class B limits.

The thing that made it work was careful layout, and making sure to
provide a specific ground return, not just dumping currents into a plane
and hoping they get back somehow.

It seems to me that people are often sloppy in this regard, then resort
to all sorts of "voodoo fixes" to make it work.

I talked to one fellow about some EMI problems he had, and I suggested
that he use some of the murata 3 terminal EMI filters. He commented to
me "those things don't work" (Immediate alarm bells, I've measured them,
and they do work!) I looked at his board, and sure enough, for him, they
don't work. The reason was that the ground lead ran through several
inches of narrow track, and when it finally conencted to  something, it
wasn't the ground pin of the affected device, it was some buffer chip's
ground pin.  He was literally tying noise sources together.

1998\10\21@145648 by Peter L. Peres

picon face
The problem is, I often have to make things that are modifications of
existing equipment, and I have to move like an elephant in a china store.
Also, most stuff I am modifying is irreplaceable. So I do what I can.

My usual problem is, that the only place where I can attach my attachement
has about 0.5 V potential over the 'clean' ground with some motor or other
supplying the current to do that. So, the only way I can use a reference
is to use one that is NOT gnd. The next best thing is my inside Vcc or a
reference voltage. So I use that, and plenty of symmetrical input
instrumentation amps or current mirror/reflector inputs for un-important
things. It works.

Peter

1998\10\21@151700 by Dave VanHorn

flavicon
face
"Peter L. Peres" wrote:
>
> The problem is, I often have to make things that are modifications of
> existing equipment, and I have to move like an elephant in a china store.
> Also, most stuff I am modifying is irreplaceable. So I do what I can.



> My usual problem is, that the only place where I can attach my attachement
> has about 0.5 V potential over the 'clean' ground with some motor or other
> supplying the current to do that. So, the only way I can use a reference
> is to use one that is NOT gnd. The next best thing is my inside Vcc or a
> reference voltage. So I use that, and plenty of symmetrical input
> instrumentation amps or current mirror/reflector inputs for un-important
> things. It works.

Still, your system should be designed and laid out properly within
itself.. The noise on the external ground is something to deal with, and
your internal ground may attach to some point on their system that isn't
ground to them. I still see no reason to compromise the osc design like
that, since it's only possible reference point is the uP's ground pin.
Is it possible that you've got multiple inputs, and current flowing
across your system through the "ground" connections?  That could cause
all sorts of nasties!


Try those Murata EMI filters on inputs. They really do give 50-60dB
supression according to the curves, and I've yet to see one cause any
unforseen effects.

1998\10\22@131154 by Peter L. Peres

picon face
On Wed, 21 Oct 1998, Dave VanHorn wrote:

> "Peter L. Peres" wrote:
>
> > My usual problem is, that the only place where I can attach my attachement
> > has about 0.5 V potential over the 'clean' ground with some motor or other
> > supplying the current to do that. So, the only way I can use a reference
> > is to use one that is NOT gnd. The next best thing is my inside Vcc or a
> > reference voltage. So I use that, and plenty of symmetrical input
> > instrumentation amps or current mirror/reflector inputs for un-important
> > things. It works.
>
> Still, your system should be designed and laid out properly within
> itself.. The noise on the external ground is something to deal with, and
> your internal ground may attach to some point on their system that isn't
> ground to them. I still see no reason to compromise the osc design like
> that, since it's only possible reference point is the uP's ground pin.
> Is it possible that you've got multiple inputs, and current flowing
> across your system through the "ground" connections?  That could cause
> all sorts of nasties!

That's exactly what happens. I have to pick off sensor signals in an
existing system and drive ground-referenced devices. This amounts to
having someone else's un-controlled ground right inside my circuit. I
can't rely on it at all, I can't even rely on it's not separating
somewhere and giving me a 220V ac jolt until the fault current sep.
breaks.

> Try those Murata EMI filters on inputs. They really do give 50-60dB
> supression according to the curves, and I've yet to see one cause any
> unforseen effects.

They tend to explode if jolted seriously with HV ;). Actually I did not
use Murata but something else like that, and gave up. There is nothing
like a large resistor in series with a potentially dangerous jolt source
;) This is not to say, that they are not good, but they upset my budget.

Peter

1998\10\24@031655 by Josef Hanzal

flavicon
face
>design, this can't be the case.  All the chip thresholds are referenced
>from ground, not from VDD, and VDD is noisy.

How does the chip know, what we selected as reference ? ;-)

Josef

1998\10\24@125609 by Dave VanHorn

flavicon
face
> >design, this can't be the case.  All the chip thresholds are referenced
> >from ground, not from VDD, and VDD is noisy.
>
> How does the chip know, what we selected as reference ? ;-)
>
> Josef

That's the point, it dosen't

1998\10\25@120706 by Peter L. Peres

picon face
On Sat, 24 Oct 1998, Josef Hanzal wrote:

> >design, this can't be the case.  All the chip thresholds are referenced
> >from ground, not from VDD, and VDD is noisy.
>
> How does the chip know, what we selected as reference ? ;-)

It's smart ;)

No, seriously, all the catalog and factory values are tested against GND.
So it might be true against Vdd and it might be not, but there is one
thing that is sure: If you complain about non-compliance to data sheet
values when these are not referenced to GND, someone at Microchip is going
to laugh himself into tears after putting the phone down ;).

Peter

1998\10\26@115148 by John Payson

flavicon
face
>>
Okay, I think I'm starting to understand this.  Basically the idea
is that you'd like what the inverter is trying to do to its end of
the crystal to match as closely as possible what the crystal wants
to do itself.  If there's a resistor between the inverter's output
and the crystal (and there's always inherent resistance if nothing
else) a properly-tuned crystal circuit should have essentially
identical waveforms on both sides of it.  If the circuit is tuned
too fast or slow, this may be seen by the inverter's output leading
or lagging the crystal's signal.  The crystal will resist being
pulled off-frequency, but the poor tuning will increase power con-
sumption, reduce frequency accuracy, and lead to increased wear on
the crystal.
<<

Sorry to respond to my own post, but I'd like to know
if I've finally figured out how selection of caps should
work, etc.

The PIC will try to operate as a fairly linear amplifying
inverter.  As the amplitude increases, it's necessary that
the PIC's gain decrease (since if the net gain around the
loop were greater than one, the oscillations would grow
exponentially); this is the cause of the slight "flat top"
observed on the PIC's output.

Because the PIC's output will try to match the input (but
inverted) the two signals should be precisely 180 degrees
out of phase.  If the phase difference is greater or less,
then the R in the circuit (real or inherent) will have to
absorb the difference between what the PIC's output is try-
ing to do and what that end of the crystal is actually do-
ing.

Using a scope, it should be possible to see if the caps are
selected appropriately: place a 1M resistor in series with
each probe, and then look at the two sides of the crystal.
The resistor will cause phase shifting on the scope input
as well as a significant loss of amplitude, but both of the
scope inputs will be affected equally.  If the caps have
been chosen correctly, the two signals should appear 180
degrees out of phase.  If this is achieved, circuit power
consumption will be minimized, and so will EMI emissions
(since the two caps will be trying to feed roughly equal
and opposite currents through their ground returns).

The biggest question I'd still have, then, would be how to
select the best value for the caps from among all those that
produce the perfect 180 degree phase shift.  Would the ideal
value be one where the ratio of the caps roughly matched the
ratio of the signal strengths (so as to best balance out the
ground currents)?


Attachment converted: wonderland:WINMAIL.DAT (????/----) (0001BE6C)

1998\10\26@120209 by Dave VanHorn

flavicon
face
If this is achieved, circuit power
> consumption will be minimized, and so will EMI emissions
> (since the two caps will be trying to feed roughly equal
> and opposite currents through their ground returns).

That's an interesting note indeed. I'm sure that the phase will be 180
out, but I'm not sure the amplitude will be the same, so they may not
cancel entirely.

> The biggest question I'd still have, then, would be how to
> select the best value for the caps from among all those that
> produce the perfect 180 degree phase shift.  Would the ideal
> value be one where the ratio of the caps roughly matched the
> ratio of the signal strengths (so as to best balance out the
> ground currents)?

The xtal is cut for a specific loading cap value. Start a bit less than
that, allowing for the stray C on the board.

1998\10\26@132233 by Peter L. Peres

picon face
On Mon, 26 Oct 1998, Dave VanHorn wrote:

>  If this is achieved, circuit power
> > consumption will be minimized, and so will EMI emissions
> > (since the two caps will be trying to feed roughly equal
> > and opposite currents through their ground returns).
>
> That's an interesting note indeed. I'm sure that the phase will be 180
> out, but I'm not sure the amplitude will be the same, so they may not
> cancel entirely.

The difference will be about the energy injected at Zo into the circuit,
divided by the Q of the crystal, or thereabouts. This is in the 'forget
it' range. Again, the correct way to match a crystal to perfect operating
conditions after the Zo is matched, is gain control in the amplifier using
a closed loop.

Peter

1998\10\26@150619 by Peter L. Peres

picon face
Hello,

 after following all this discussion, I've come to a practical idea. I
have worked with stable oscillators before, and I'd like to see how stable
a PIC can be made using easily bought components. I propose to exchange
data on this on the list.

 I have the following ideas:

1) Temperature stabilization. The two obvious ways are crystal oven and
thermistor controlled varactor. The oven is often ruled out due to power
constraints, but the one-thermistor method could be used. Commercial
expensive thermistors are ruled out. So I'd like to see how a transistor's
2.2 mV/K could be used for this while being itself the varicap (Ccb ?).
Other ways ?

2) Amplitude stabilization. The purpose is to reduce the drive level
measured at the Xout pin as much as possible without causing malfunction
of the PIC. This is to be achieved by reducing the coupling from the Xout
to the frequency selective element in a closed loop. The usual way is
metering and negative feedback applied to a linear gain controlling
element. This could be a PIN diode, a Si diode, or other ? Two desirable
side effects: Power consumption should be reduced, and RFI also. How to do
this (without using an op-amp or special parts) ?

any1 ?,

Peter

1998\10\26@150625 by Peter L. Peres

picon face
On Mon, 26 Oct 1998, John Payson wrote:

> sumption, reduce frequency accuracy, and lead to increased wear on
> the crystal.

There is no 'wear' on the crystal when operated in its SOA. There is
ageing but that has almost nothing to do with the oscillation.

> The PIC will try to operate as a fairly linear amplifying
> inverter.  As the amplitude increases, it's necessary that
> the PIC's gain decrease (since if the net gain around the
> loop were greater than one, the oscillations would grow
> exponentially); this is the cause of the slight "flat top"
> observed on the PIC's output.

The PIC is nowhere 'fairly linear'. You can expect 5% and worse distortion
from it, in the 'linear' operating area of the oscillator gate.

> Because the PIC's output will try to match the input (but
> inverted) the two signals should be precisely 180 degrees
> out of phase.  If the phase difference is greater or less,
> then the R in the circuit (real or inherent) will have to
> absorb the difference between what the PIC's output is try-
> ing to do and what that end of the crystal is actually do-
> ing.

No, this would be true for a series crystal. The crystal used with a PIC
is parallel so you can treat it as a very narrow bandpass filter. Whatever
the signal at its output, if it contains even a little component on its
center frequency, it will select it, flip it 180 degrees and send it back
to the amplifier input with some loss.

This is also how it starts up. Noise at the output of the amplifier
contains energy on all the frequencies in the GBW band of the amplifier.
The tiny part in it that falls on the crystal center frequency is selected
and fed back to the amplifier and oscillation starts.

The startup for a given gain and noise depends directly on the Q of the
crystal (or rather, on the bandwidth of the filter ;). Low Q oscillators
start faster. Ceramic and SAW filter oscillators start very fast vs.
crystals.

> scope inputs will be affected equally.  If the caps have
> been chosen correctly, the two signals should appear 180
> degrees out of phase.  If this is achieved, circuit power

The signals will practically never be 180 degrees out of phase. The extra
gain in the amplifier sees to that. You can only get 180 degrees clean if
the gain of the amplifier is controlled down in an active loop to stay in
the linear area. I'll keep saying this, sorry.

> consumption will be minimized, and so will EMI emissions
> (since the two caps will be trying to feed roughly equal
> and opposite currents through their ground returns).

You can never rely on this. The caps and the chip grounds must be as
intimate as possible.

> The biggest question I'd still have, then, would be how to
> select the best value for the caps from among all those that
> produce the perfect 180 degree phase shift.  Would the ideal
> value be one where the ratio of the caps roughly matched the
> ratio of the signal strengths (so as to best balance out the
> ground currents)?

If you want to be picky, you can use the actual crystal parameters, the
equivalent circuit of the amplifier input, and the equivalent circuit of
the amplifier output, and calculate Cout so the impedance at the output
matches the generator Q*Zo and Cin to the impedance at the input so it
matches Q*Zin. The actual calculus can be obtained from a crystal filter
design chapter in a book. These are just scribbled equations here, they
have nothing to do with reality. One interesting thing is, that you will
most likely end up with totally impossible part values for the circuit,
will give up, and will use the crystal manufacturer's specced capacitors
instead, so you can phone him and complain if it does not work ;)

Peter

1998\10\26@164318 by Scott Dattalo

face
flavicon
face
On Mon, 26 Oct 1998, Peter L. Peres wrote:

> 1) Temperature stabilization. The two obvious ways are crystal oven and
> thermistor controlled varactor. The oven is often ruled out due to power
> constraints, but the one-thermistor method could be used. Commercial
> expensive thermistors are ruled out. So I'd like to see how a transistor's
> 2.2 mV/K could be used for this while being itself the varicap (Ccb ?).
> Other ways ?


Mike Keitz posted a PIC-PLL that varied the pic's oscillation frequency
based on this principle (i.e. using the variable capacitance of a reverse
biased diode in a tuned circuit to change the resonant frequency). If
you're striving for oscillator accuracy it might be more desirable to use
this phase locking technique along with another closed-loop highly
accurate analog system. For example, if you had a means by which it was
possible to accurately measure frequency then you could use this circuit
to vary the diode's capacitance to compensate for errors. One such system
that comes to mind is a V/F converter. Of course, this isn't as elegant as
a 2N3904... but then again, if temperature is the only source of error
then it would be trivial to measure the temperature and compensate for
it's affect using the variable capacitance of the diode.

BTW, if you subscribe to Electronic Design you may want to check out last
week's 'Ideas for Design' section. They feature a 'Variable-Capacitance
Diode Phase Modulator' - a name I'm sure I heard on a Star Trek episode.
The diode (or bank of them I should say) is a good ol' 1N4003.


Scott

1998\10\26@195215 by John Payson

flavicon
face
[quoting]
Mike Keitz posted a PIC-PLL that varied the pic's oscillation frequency
based on this principle (i.e. using the variable capacitance of a reverse
biased diode in a tuned circuit to change the resonant frequency). If
you're striving for oscillator accuracy it might be more desirable to use
this phase locking technique along with another closed-loop highly
accurate analog system.

[me]
Hmm... for people in North America, how about a 10.00Mhz radio
receiver?  The WWV broadcasts are amplitude modulated on a
*VERY* accurate 10MHz carrier.  Provided you're not too close
to some other source of 10MHz'ish noise, this should give you
a good 10MHz reference frequency (if you use an analog PLL to
fill any brief gaps caused by nearby random EMI, it should be
accurate to within a part per trillion or so.


Attachment converted: wonderland:WINMAIL.DAT 1 (????/----) (0001BE70)

1998\10\27@064235 by Sean Breheny

face picon face
At 06:51 PM 10/26/98 -0600, you wrote:
>[me]
>Hmm... for people in North America, how about a 10.00Mhz radio
>receiver?  The WWV broadcasts are amplitude modulated on a
>*VERY* accurate 10MHz carrier.  Provided you're not too close
>to some other source of 10MHz'ish noise, this should give you
>a good 10MHz reference frequency (if you use an analog PLL to
>fill any brief gaps caused by nearby random EMI, it should be
>accurate to within a part per trillion or so.

I doubt that it would end up being that accurate. Your PLL would begin to
drift during EMI spikes, as you suggest. Also, this signal is primary
reaching most of N.A. through skip propagation, which involves reflection
from the ionosphere, which is a somewhat non-linear system and I would
think would tend to vary the frequency somewhat. Also, the signal will be
modulated due to propagation changes, which ALONE will cause its frequency
to differ slightly, by a few Hz, much more than a ppT.

However, it IS an interesting idea that may have merit, because very few
people need ppT accuracy!

I have often thought that one could get a VERY accurate frequency standard
by taking several xtal oscilators and putting them in one oven. The
capacitors in half of them would have a positive temp coefficient and those
the the other half would have a negative temp coefficient(we could even
weight these coefficients to compensate for the xtals' coefficients). We
could then average the outputs of all of them together, and use it to
create error signals for each one, which could be fed back to maybe a
varactor in each one. Of course, I don't think anyone will be using this
for a PIC any time soon <G>

Sean

+-------------------------------+
| Sean Breheny                  |
| Amateur Radio Callsign: KA3YXM|
| Electrical Engineering Student|
+-------------------------------+
Save lives, please look at http://www.all.org
Personal page: http://www.people.cornell.edu/pages/shb7
TakeThisOuTshb7EraseMEspamspam_OUTcornell.edu  Phone(USA): (607) 253-0315 ICQ #: 3329174

1998\10\27@103323 by Sten Dahlgren

flavicon
face
Could someone supply me with the URL to the tutorial that arriwed
yeasterday ?
I started download but it took so long time that the conntection closed,
and i didn't
save the link.

regards
/Sten
--
Sten Dahlgren  ! I'd rather have 39 hp under my right arm than
Enea Data AB   ! one horse under my bottom !
Box 232        !
183 23 TŠby    !
Sweden         !
+46 8 6385038  !
RemoveMEstdaspamTakeThisOuTenea.se   !

1998\10\27@120014 by John Payson

flavicon
face
>Hmm... for people in North America, how about a 10.00Mhz radio
>receiver?  The WWV broadcasts are amplitude modulated on a
>*VERY* accurate 10MHz carrier.  Provided you're not too close
>to some other source of 10MHz'ish noise, this should give you
>a good 10MHz reference frequency (if you use an analog PLL to
>fill any brief gaps caused by nearby random EMI, it should be
>accurate to within a part per trillion or so.

| I doubt that it would end up being that accurate. Your PLL would begin to
| drift during EMI spikes, as you suggest. Also, this signal is primary
| reaching most of N.A. through skip propagation, which involves reflection
| from the ionosphere, which is a somewhat non-linear system and I would
| think would tend to vary the frequency somewhat. Also, the signal will be
| modulated due to propagation changes, which ALONE will cause its frequency
| to differ slightly, by a few Hz, much more than a ppT.

Hmm... actually I meant to suggest a combination analog/digital PLL (since
both types have advantages); essentially my idea would be to use the WWV
signals to trim a crystal oscillator to maintain frequency and phase with the
incoming signal.  Since the loop gain wouldn't need to be very high, and it
should be possible to detect incoming signal loss (and hold the current
frequency in such an event) it should be possible to keep accurate time
during brief interruptions. As for problems from changing signal paths, each
time you lock onto a new reference signal, you are going to gain or lose at
most half a cycle.  If your design is balanced so that gains and losses
will more or less match, 1ppT accuracy should be obtainable I would think
(gaining or losing one cycle, on average, per 100 seconds).  To be sure,
there would be some short term variations (e.g. if a plane flies overhead
and your signal is reflected off the plane you may have some doppler shift)
but I would expect that over any significant time those effects would be
more or less balanced.

| I have often thought that one could get a VERY accurate frequency standard
| by taking several xtal oscilators and putting them in one oven. The
| capacitors in half of them would have a positive temp coefficient and those
| the the other half would have a negative temp coefficient(we could even
| weight these coefficients to compensate for the xtals' coefficients). We
| could then average the outputs of all of them together, and use it to
| create error signals for each one, which could be fed back to maybe a
| varactor in each one. Of course, I don't think anyone will be using this
| for a PIC any time soon <G>

A somewhat simpler approach is to use a crystal oscillator and a temperature
sensor.  When the unit is assembled, you measure the frequency of the crys-
tal at different temperatures within the device's operating range.  From what
I've been told, this technique can be a good way to eke out a little big of extr
a
accuracy provided the circuit's characteristics don't change too much over
time (e.g. from contamination on the PCB altering the trace capacitance, etc.)
This sort of thing is well within a PIC's abilities, though it would probably be
better to use an external crystal oscillator.


Attachment converted: wonderland:WINMAIL.DAT 2 (????/----) (0001BE74)

1998\10\27@131843 by Scott Newell

flavicon
face
>>Hmm... for people in North America, how about a 10.00Mhz radio
>>receiver?  The WWV broadcasts are amplitude modulated on a
>>*VERY* accurate 10MHz carrier.  Provided you're not too close

WWVB will be more accurate, due to propagation effects.  Signal strength
can be a problem, currently, but upgrades are taking place.

Stanford Research Systems, among others, has a disciplined timebase that
uses the LORAN chain as a reference.  GPS based systems seem to becoming
more popular as well.


>I have often thought that one could get a VERY accurate frequency standard
>by taking several xtal oscilators and putting them in one oven. The
>capacitors in half of them would have a positive temp coefficient and those
>the the other half would have a negative temp coefficient(we could even
>weight these coefficients to compensate for the xtals' coefficients). We
>could then average the outputs of all of them together, and use it to
>create error signals for each one, which could be fed back to maybe a
>varactor in each one. Of course, I don't think anyone will be using this
>for a PIC any time soon <G>

I suspect (haven't worked through the numbers) that with a good double
oven, crystal aging will be more of a factor than tempco.  Especially with
a top quality double rotation cut crystal (SC-type).

One neat trick that's been done with a SC cut rock is to use the B mode
oscillation  frequency (which has a significant tempco) as the temperature
sensor.  I still have a hard time picturing a crystal oscillating at two
frequencies simultaneously, with one mode showing a moderate tempco and the
other mode showing almost none.  Scary stuff! :-)


newell

1998\10\28@002435 by Arnold Grubbs

flavicon
face
John Payson wrote:
{Quote hidden}

tra
> accuracy provided the circuit's characteristics don't change too much over
> time (e.g. from contamination on the PCB altering the trace capacitance, etc.)
> This sort of thing is well within a PIC's abilities, though it would probably
be
> better to use an external crystal oscillator.
>
>                    Name: WINMAIL.DAT
>     Part 1.2       Type: unspecified type (application/octet-stream)
>                Encoding: x-uuencode


Another route you can go if you want good accuracy would be to us the
1PPS
output of a GPS receiver.  An artical in the ARRL  Ham radio magazine
QST showed
using a PLL to lock on to the 1 pulse per second signal put out by
a GPS receiver.  I don't remember the issue it was in, but it seems that
it would
be a lot less trouble than having a lot of xtal oscillators and ovens.

Another place to look would be the TAPR web pages on the TAC-1 kit.
The TAC-1 [totaly accurate clock] info can be found at
http://www.tapr.org/tapr/html/tac2.html
And the kit is for sale for less than $140 I beleive.

Hope that might help you out!

AG

1998\10\28@010556 by Dennis Plunkett

flavicon
face
At 23:11 28/10/98 -0600, you wrote:
{Quote hidden}

of extra
>> accuracy provided the circuit's characteristics don't change too much over
>> time (e.g. from contamination on the PCB altering the trace capacitance,
etc.)
>> This sort of thing is well within a PIC's abilities, though it would
probably be
{Quote hidden}

And that's not all.

Yes Dennis is back from Japan.

Ok there are also many other methods to get an accurate frequency. Your
telecommunications carrier will have two numbers that you can ring up, the
first is a 3kHz tone and the second is a 2kHz tone, mix and 1kHz! Very accurate.

Here in Australia, one can tap into the re sync signal in the ABC TV B/CST.
This will provide an accurate 16625Hz ref that is based on a 1-12 accurate
clock.

Until recently there was also the Omega ground stations, these where also
very accurate, and where in the 9 to 14kHz range (If I remember correctly)

Also we can wait for Digital TV, there should also be data in there that we
can use.

There are also pre aged crystals (And TCXOs) that have known characteristics
over time, and 1ppm is very possible. I think that there is a Phillips
system that uses this (Among others)

Dennis

1998\10\28@065828 by vk7krj

flavicon
face
There is a very good frequency "standard" in most homes, in the humble
colour tv. The colour burst crystal is phase locked to the stations master
oscillator, and (at least here in Australia) that can be traced back to a
very accurate standard. IIRC, here it is a rhubidium standard, I guess it
is the same in most countries.
A crystal oscillator phase-locked to the colour-burst crystal will give an
accuracy better than the all but the best temperature-compensated crystal
oscillator (but only when the tv is receiving a colour picture of course).

Cheers, Ken
vk7krjEraseMEspam.....southcom.com.au

1998\10\28@101907 by Martin McCormick

flavicon
face
Ken Johnson writes:
>There is a very good frequency "standard" in most homes, in the humble
>colour tv. The colour burst crystal is phase locked to the stations master
>oscillator, and (at least here in Australia) that can be traced back to a
>very accurate standard. IIRC, here it is a rhubidium standard, I guess it
>is the same in most countries.

       I read in "QST" that this was once true in the United States,
but not so much any more.  Television stations now use digital frame
synchronizers to make up for small timing differences so that the
color burst signal you get now is locally generated and not
phase-locked to the network's rhubidium standard.  It is probably
still good, but not as close to perfect as it used to be when it was
tightly coupled.


Martin McCormick WB5AGZ  Stillwater, OK
OSU Center for Computing and Information Services Data Communications Group

1998\10\28@125943 by Peter L. Peres

picon face
On Wed, 28 Oct 1998, Martin McCormick wrote:

> Ken Johnson writes:
> >There is a very good frequency "standard" in most homes, in the humble
> >colour tv. The colour burst crystal is phase locked to the stations master
> >oscillator, and (at least here in Australia) that can be traced back to a
> >very accurate standard. IIRC, here it is a rhubidium standard, I guess it
> >is the same in most countries.
>
>         I read in "QST" that this was once true in the United States,
> but not so much any more.  Television stations now use digital frame
> synchronizers to make up for small timing differences so that the
> color burst signal you get now is locally generated and not
> phase-locked to the network's rhubidium standard.  It is probably
> still good, but not as close to perfect as it used to be when it was
> tightly coupled.

You are right, not only TBC/DFS is used, but many new studios use digital
processing. However, the precision of these is even better than the
highest precision required before ! The whole studio, including TBC/DFSs
are synchronized in a network to a single master clock that is usually
connected over computer network to an atomic clock. If this was not true,
all the studio-to-studio connections would be unmanageable even with TBCs
etc.

Only small stations that cannot afford the hardware are under standards
and make do somehow.

Peter

1998\10\28@125953 by Peter L. Peres

picon face
PS to my previous posting re: using some radio beacon as frequency
standard:

I'd like to point out to would be experimenters that although air and
naval band frequencies are easy to work with in direct amplifying
receivers, having a digital circuit operating at a sub-harmonic of it on
the same board, is not, and the direct binary divider is just that. So the
divider that handles this can't be binary and should have a prime divider
at least. Even that may not be enough.

Another way is, to use a double-IF heterodyne to move the divider
harmonics out of the carrier band. This uses two IF strips, the carrier is
mixed up for one, and down for the other with a LO that has good short
term stability, then the IF outputs are counted (one) and the difference
between them is counted (another or the same counter, switched). The
difference locks the LO in a PLL and the counter counts the IF. The
counter timebase is derived from LO. There is a way to save some money by
using one IF strip and switching the input between mixed up/mixed down,
with cunning counters or a micro (PIC ?) doing the rest and relying on
good LO stability over short term to give a small difference in successive
measurements.

I guess I've managed to bring the topic back to PICs.

Peter

1998\10\28@125958 by Peter L. Peres

picon face
On Wed, 28 Oct 1998, Ken Johnson wrote:

> There is a very good frequency "standard" in most homes, in the humble
> colour tv. The colour burst crystal is phase locked to the stations master
> oscillator, and (at least here in Australia) that can be traced back to a
> very accurate standard. IIRC, here it is a rhubidium standard, I guess it
> is the same in most countries.
> A crystal oscillator phase-locked to the colour-burst crystal will give an
> accuracy better than the all but the best temperature-compensated crystal
> oscillator (but only when the tv is receiving a colour picture of course).

This is very correct in the USa and other places which have NTSC and is
incorrect for Australia and places which have PAL because the color
decoder crystal is phase modulated at +/-90 degrees every other line, and
this phase modulation is a pain to remove for other uses.

*However* if a local radio station is strong enough then its carrier can
be received in a direct conversion receiver and divided directly. Provided
it is not some pirate transmitter, it should be linked to a very good
frequency standard in most countries. AM is better than FM here and AM
beacons are best (such as used for naval and aviation purposes).

BUT I was interested in a stand-alone, simple set of methods.

Peter

1998\10\28@132005 by paulb

flavicon
face
Peter L. Peres wrote:

> This is very correct in the USA and other places which have NTSC and
> is incorrect for Australia and places which have PAL because the color
> decoder crystal is phase modulated at +/-90 degrees every other line,
> and this phase modulation is a pain to remove for other uses.

 I can't see why.  Surely you would use a chroma decoder chip to do
exactly that?
--
 Cheers,
       Paul B.

1998\10\28@171815 by cousens

flavicon
face
Peter L. Peres wrote:
Not always so I was flipping through the fm band in london some years
ago ( just after the launch of the national radio-one on the fm band )
The new radio one station was 3hz off frequency (could have been my
equipment)
the national radio-two was 7hz off freq.

One the two London comercial station, Capital Radio, was 280khz off freq
LBC, the other, about 200hz
After a phone call to the DTI radio division the next day
Capital (bubble gum) Radio was only 150hz off

> *However* if a local radio station is strong enough then its carrier can
> be received in a direct conversion receiver and divided directly. Provided
> it is not some pirate transmitter, it should be linked to a very good
> frequency standard in most countries. AM is better than FM here and AM
> beacons are best (such as used for naval and aviation purposes).

FM is also difficult to measure (75khz modulation) you have to wait
for the music to stop to get an accurate reading (and the DJ to shut up)

I use a digital scanning receiver with a frequency counter permanantly
connected to the 10.7mhz 1st. IF out (it also has a 455khz output)
it serves as a tuning aid and a quick guide to the stations status
(licensed or pirate)

>
> BUT I was interested in a stand-alone, simple set of methods.
>
> Peter

--
Peter Cousens
email: EraseMEcousensspamher.forthnet.gr  phone: + 3081 380534
snailmail:  Folia, Agia Fotini, Karteros, Heraklion  Crete, Greece.

Is it true that they have, on the new version of windows
managed to increase the MTBF from 95 to 98 minutes ?
(That's why they called it 95)

1998\10\29@132136 by Peter L. Peres

picon face
On Thu, 29 Oct 1998, Paul B. Webster VK2BZC wrote:

> Peter L. Peres wrote:
>
> > This is very correct in the USA and other places which have NTSC and
> > is incorrect for Australia and places which have PAL because the color
> > decoder crystal is phase modulated at +/-90 degrees every other line,
> > and this phase modulation is a pain to remove for other uses.
>
>   I can't see why.  Surely you would use a chroma decoder chip to do
> exactly that?

The crystal ON the PAL chroma decoder follows the phase jumps of the input
burst from line to line. There are decoders that use a double frequency
crystal (8.8MHz)  which don't. These could be used to extract the locked
color carrier.  However, even here I am not sure if they won't jump from
field to field because of the color framing requirements. The 8.8MHz chips
are by Philips (TDA series).

Peter

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...