oscillators on PCB?

Hi there,

Why people use oscillators with AVR microcontrollers?

Why they choose different values of oscillators?

What are the considerations when installing a oscillator on PCB? any pitfalls? Should they be closer to AVR? away from power line and source?

I need some tips about this. Thanks

Regards

smdFan:
Hi there,

Why people use oscillators with AVR microcontrollers?

Why they choose different values of oscillators?

What are the considerations when installing a oscillator on PCB? any pitfalls? Should they be closer to AVR? away from power line and source?

I need some tips about this. Thanks

Regards

MCUs don’t work unless they have an oscillator.

The oscillator frequency used in a particular design is a trade-off between performance and power consumption. Sometimes a specific value is needed that divides down to give standard baud rates for serial comms.

An oscillator module can be some distance from the MCU. Oscillator crystals and their capacitors need to be as close as possible to the MCU.

Leon

leon_heller:

smdFan:
Hi there,

Why people use oscillators with AVR microcontrollers?

Why they choose different values of oscillators?

What are the considerations when installing a oscillator on PCB? any pitfalls? Should they be closer to AVR? away from power line and source?

I need some tips about this. Thanks

Regards

MCUs don’t work unless they have an oscillator.

The oscillator frequency used in a particular design is a trade-off between performance and power consumption. Sometimes a specific value is needed that divides down to give standard baud rates for serial comms.

An oscillator module can be some distance from the MCU. Oscillator crystals and their capacitors need to be as close as possible to the MCU.

Leon

Thanks Leon.

Suppose you have a microcontroller run by a 3 V battery. The microcontroller is supposed to run for the life of the battery. So what would be the maximum frequency of the oscillator.

Is there some kind of formula to calculate the max freq. of oscillator you can use for a particular battery?

You mentioned that w/o oscillators, the MCU will not operate. How about the internal oscillator of the MCU?

Thanks

Regards

You need to read the MCU data sheet for that information.

Many MCUs have an internal oscillator but it isn’t stable enough for many applications.

Leon

leon_heller:
MCUs don’t work unless they have an oscillator.

Many MCUs have built in oscillators. The primary benefit is that this reduces component count. The disadvantages includes accuracy and frequency. If you require higher performance and or oscillator accuracy, you have to add an external oscillator to your circuit.

muntron:

leon_heller:
MCUs don’t work unless they have an oscillator.

Many MCUs have built in oscillators. The primary benefit is that this reduces component count. The disadvantages includes accuracy and frequency. If you require higher performance and or oscillator accuracy, you have to add an external oscillator to your circuit.

What are the most common frequencies of oscillators used along with AVR microcontrollers?

Regards

Impossible to say.

Leon

leon_heller:
Impossible to say.

Leon

A couple of years ago when I was dealing with AVRs, I think I would notice 4 MHz and 8 MHz a lot. But I am not sure

.

Greetings smdFan,

smdFan:
Why people use oscillators with AVR microcontrollers?

(1) Some uC devices do not have internal (RC) oscillators. (2) Internal oscillators have lower accuracy than external ones.

smdFan:
Why they choose different values of oscillators?

Power consumption id directly proportional to clock speed.

Slowing the uC will extend battery life. Some oscillators have “magic”

numbers that when divided down provide industry standard timing

(for serial data comms) or accurate RTC (Real Time Clock) values.

An oscillator with a binary-weighted value requires fewer components

to divide down to a standard frequency. Example: a “32kHz”

crystal is really 32.768KHz, when divided by 2^15 (i.e.

fifteen binary counter stages with no feedback) you will get

1pps (one pulse per second). Used in all digital watches and clocks!

smdFan:
What are the considerations when installing a oscillator on PCB? any pitfalls? Should they be closer to AVR? away from power line and source?

Depends if the “oscillator” is analog or

digital. A digital oscillator is a packaged device with all the

analog parts inside, and only supply, ground, and a digital output

pin. The device can be placed “anywhere”, but will work

better away from varying temps (power resistors, ICs, etc).

A crystal or resonator requires the internal analog circuits

of the IC (uC in this case). The leads should be very short,

attention paid to both shunt capacitance and short ground

path returns. No other signals (even power and ground) should

pass under or near the crystal and it’s loading capacitors.

The capacitors should be NPO types. If the PCB has a

ground or power plane that should be removed under the

crystal and associated traces.

Comments Welcome!

bigglez:
The capacitors should be NPO types. If the PCB has a

ground or power plane that should be removed under the

crystal and associated traces.

Taking a straw poll of various bits of hardware lying around here, I notice some do and some don’t. The 3com 3c905 ethernet card has the ground plane removed under the crystal (actually, I think it’s an oscillator, a 4 pin device) for both the 25MHz and 20MHz devices.

However, the Intel ethernet card I have here does not have the ground plane removed around the timing device (which I think again is an oscillator rather than a crystal).

I’ve seen other designs where people have a ground plane under a crystal, and other designs where the ground plane was removed.

On reading up about it, when I designed my ethernet board, I removed the ground plane under the crystal/traces to the MAC/PHY. In the layout guide from the chip manufacturer, they admonished you to keep the xtal lines away from the analogue power supply, but they put a 1.8v analogue supply pin right next to the crystal input, forcing you to bring the 1.8v supply close to the traces from the crystal! (The best I could do is steer the 1.8Va trace away from the xtal traces as soon as it left the pad). The board works well, so I suppose I must have got it right enough :slight_smile:

Presumably, in the case of a 4-pin crystal oscillator in a can, there’s no need to drop out the ground plane around the output trace from the oscillator - why might the designer of the 3c905 PCB have dropped the ground plane out around the oscillator, but the Intel designer not? (Surely an oscillator will have a fairly low impedance output).

Generally, how close is considered best practise? For my ethernet board, I got it in as close as possible, which resulted perhaps in a trace length of around 7mm. What about the trace lengths - I presume it’s best practise to get the length of the two traces as close as possible to being the same (forgive me if this sounds like a stupid question, I’m a hobbyist not an engineer!)

Differences in track length won’t have any effect - try calculating the wavelength of the clock frequency.

Leon

Well, I was thinking more of parastic inductance and capacitance. What had me thinking about this was the manufacturer’s layout guide advising that track lengths from the ethernet transformer to the chip are kept as similar as possible. With 100baseTX only having a fundamental frequency of 31.25 MHz, I presumed it was so the parasitic inductance/capacitance on each PCB trace was similar rather than timing issues.

That’s more to do with impedance and VSWR. It doesn’t matter with oscillators.

Leon

Greetings Leon,

leon_heller:
Differences in track length won’t have any effect - try calculating the wavelength of the clock frequency.

Differences in track (trace) length will have a significant

effect on timing skew. That is why memory and processor

PCB design requires accurate trace length matching.

The Rule Of Thumb propagation speed of FR-4 PCB material

(most common) is 6ins per nanosecond. (About 1/4 the

speed of light). To delve deeper into this theory here’s a

very [useful reference.

It might also help to read the Wikipedia entry for [Transmission Lines,

or review the RSGB Handbook.

There is a more rigorous treatment for PCB Striplines [here.

Comments Welcome!](Microstrip - Wikipedia)](Transmission line - Wikipedia)](http://preview.tinyurl.com/4ed8c9)

Greetings Leon,

leon_heller:
That’s more to do with impedance and VSWR. It doesn’t matter with oscillators.

I'm with Winston on this one. The parastitic capacitance

of even a short PCB trace will affect a crystal. Even a

low frequency unit (popular 32KHz for example). The

crystal is tuned at the factory for a reference capacitance,

adding to it will pull the crystal lower. A typical load

capacitance standard is 20pF, which doesn’t leave much

room for poor PCB design.

The dielectric constant of fiberglass/epoxy is 4.0 to 5.5

for FR-4, creating a capacitance of approximately 200

picoFarads per square inch.

See [United States Patent 5469324, Integrated decoupling
capacitive core for a printed circuit board and method
of making same.

The second issue is that crystal drive circuits are

high impedance, low power, and suceptible to RF/EMI

interference, which only increases with larger antenna

(PCB trace) area.

Comments Welcome!](http://preview.tinyurl.com/52nogm)

I’m talking about a few mm, not several cm. The additional capacitance will only be a fraction of a pF. The capacitor tolerances will have a much larger effect.

Leon

Greetings Leon,

leon_heller:
I’m talking about a few mm, not several cm. The additional capacitance will only be a fraction of a pF. The capacitor tolerances will have a much larger effect.

Well, I had read your last three posts to this thread and

I must have missed your point…

Fri Jun 20, 2008 12:19 pm

leon_heller:
Impossible to say.

Mon Jun 23, 2008 6:00 am

leon_heller:
Differences in track length won’t have any effect - try calculating the wavelength of the clock frequency.

Tue Jun 24, 2008 2:40 am

leon_heller:
That’s more to do with impedance and VSWR. It doesn’t matter with oscillators.

Comments Welcome!

I don’t see any inconsistency there. No-one in their right mind puts a crystal more than a cm or so from the MCU.

Unlike the connections to an Ethernet transformer the connections to a crystal do not constitute a transmission line.

Leon

winston:

bigglez:
The capacitors should be NPO types. If the PCB has a

ground or power plane that should be removed under the

crystal and associated traces.

Taking a straw poll of various bits of hardware lying around here, I notice some do and some don’t. The 3com 3c905 ethernet card has the ground plane removed under the crystal (actually, I think it’s an oscillator, a 4 pin device) for both the 25MHz and 20MHz devices.

However, the Intel ethernet card I have here does not have the ground plane removed around the timing device (which I think again is an oscillator rather than a crystal).

I’ve seen other designs where people have a ground plane under a crystal, and other designs where the ground plane was removed.

On reading up about it, when I designed my ethernet board, I removed the ground plane under the crystal/traces to the MAC/PHY. In the layout guide from the chip manufacturer, they admonished you to keep the xtal lines away from the analogue power supply, but they put a 1.8v analogue supply pin right next to the crystal input, forcing you to bring the 1.8v supply close to the traces from the crystal! (The best I could do is steer the 1.8Va trace away from the xtal traces as soon as it left the pad). The board works well, so I suppose I must have got it right enough :slight_smile:

Presumably, in the case of a 4-pin crystal oscillator in a can, there’s no need to drop out the ground plane around the output trace from the oscillator - why might the designer of the 3c905 PCB have dropped the ground plane out around the oscillator, but the Intel designer not? (Surely an oscillator will have a fairly low impedance output).

And if that wasn’t enough, I’ve been looking at some crystals myself, in SMD packages. They’re four terminal devices, two for the crystal, and the other two are connected to the package’s metal “shield” and according to the datasheet, are meant to be grounded.

So even if I remove the ground plane from under the crystal, I’m adding (some of?) it back by connecting the ground pins.

I do remember Microchip has a few app notes on oscillators. I have to go through those again, and I think one of them provided a rough guideline that stray capacitance on the pins and traces could contribute ~1pF to the loading of the crystal. I don’t remember if that’s with or without a ground plane though.

The grounding improves the stability of the crystal and minimises emissions, the cases of two terminal crystals are often grounded.

It probably would add to the capacitance, as you suggest.

Leon