Use of 1 M resistor with external crystal/resonator

Coming to Arduino from the PIC world, I was surprised to see that the Atmel data sheet (atmega32u4) doesn't recommend using a 1 M resistor in parallel with an external resonator. Looking at the reference design for the Leonardo, the resistor is present. Looking at the schematics on Adafruit and Sparkfun for 32u4 compatible designs, it is not present.

Should I include the resistor in my own designs or assume it is not required?

Thanks, Jamie

Could put pads on, and test to see if the resistor makes any difference.

I do what the datasheet says (I.e. no resistor) and have never had a problem with the oscillator. I think one of the Atmel datasheets or app notes says the resistor is provided internally.

Can't say I have seen the 1Meg referenced in any of the Atmel PDF sheets I have read, but I did remember (and found this morning) this reference from the past: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=50424&start=0

Ray

It's in this AVR Hardware Design Considerations documentation.

http://www.atmel.com/Images/doc2521.pdf

See chapter 5 Using crystal and ceramic resonators, figure 5-1.

A ceramic resonator is lossy compared to a crystal and the resistor increases the gain of the inverters forming the clock oscillator to compensate for this loss. The absolute requirement for additional dc feedback is dependent on the resonator as well s the oscillator circuit. Resonators of the same type made by different MFr's may require the resistor and some may not one might require it to stabilize the oscillator for differences in the resonator (A loading or swamping resistor) another may require it for lower Vcc sources and a third might require it for different clock frequency ranges and a fourth might require it for stability (driving the resonator harder). The differences are due to oscillator circuits, resonator differences, and Mfr's preferences in design and design practices and PC board layout. Perhaps to make a point, I can't remember ever seeing or using a resistor across a crystal in my professional career. Usually the lack of a needed one is a great deal more serious than the presence of an un-necessary one because the resistors provide very little if any RF feedback (the oscillator frequency) but do change the DC operating point of the gain package (inverters) that drive the resonator. Sometimes in very low frequency/power oscillators a series resistor is required to prevent internal heating due to high drive conditions and the attendant issues with that condition.

Doc

As Crossroads pointed out, having the pads and not using them is ok too, It doesn't cost anything for SMT pads,. It can however be costly to have to add them, should they be found necessary

http://www.atmel.com/Images/doc2521.pdf Not a 404 ? "The requested page cannot be found." This works: http://www.atmel.com/images/doc2521.pdf Doc

Docedison: http://www.atmel.com/Images/doc2521.pdf Not a 404 ? "The requested page cannot be found."

Doc

The letter "I" in the URL needs to be changed to lower case.

And the resistor is internal to the AVR. 328P, 2560, 32U4 , no external resistor needed.

Docedison: A ceramic resonator is lossy compared to a crystal and the resistor increases the gain of the inverters forming the clock oscillator to compensate for this loss. The absolute requirement for additional dc feedback is dependent on the resonator as well s the oscillator circuit.

I don't see that. The inverter within the chip must be biased into the linear region in order to oscillate reliably, and unless the resonator is leaky (which it would be unwise to assume), the resistor (either internal or external) is needed to ensure that. As for increasing the gain, the only mechanism I can see for the resistor to do that is that it biases that inverter at mid-point, which is approximately the point at which gain is highest. Is that what you meant?

I would always use a resistor in a crystal oscillator circuit of this type, except where the chip already has one internally (as in the Atmega series).

According to the schematics for the 328 and Leonarda a1M resistor is used on the 328 and the 32U4 oscillator circuits (from The products page) And A quote from section 5 of http://www.atmel.com/images/doc2521.pdf

The ceramic resonator is very similar to the AT-cut parallel resonant crystal, but is so to say a low cost, low quality version of the crystal. The ceramic resonator has a lower Q-value, which is both an advantage and disadvantage.

It is the lower Q value that requires somewhat more excitation (higher gain) there is also that resonators as I pointed out earlier are different from Mfr to Mfr and some require more excitation than others which is probably the reason that, while the 328 and 32U4 have internal bias resistors external ones are also required. I had thought there was a resistor on the resonator in my Uno's, some time back I was thinking to replace the resonator with a crystal and I remember looking and thinking "of course" before I gave it up as a job with little chance of clean results.

Doc

I agree that a resonator has higher losses than a crystal, and therefore requires greater drive power and possibly higher gain from the inverter. However, I don't believe that adding an external resistor serves any purpose, when there is already an internal one. The internal resistor is sufficient to bias the inverter into the linear mode. Adding an external resistor will simply decrease the apparent input resistance of the inverter.

Just because the designers of the Uno and Leonardo included a 1M resistor in the hardware designs doesn't mean that the resistor is necessary. The Arduino software is poorly implemented in places, so I've no reason to believe that the hardware design is perfect.

i agree with dc42, an external resistor serves little purpose. some designers, even experienced professionals, are fond of throwing in extra components based on feelings and misplaced tradition rather than sound design practice. theres about 3 megohm one built into most avrs. you can measure it with a meter. however virtually no "leakage" in any of the couple dozen resonators ive tested ranging from 125khz to 16mhz. at least no reading on 10 megohm range. fingers, yes. resonators and crystals, no. imo many components on some arduino boards are put there "just for the heck of it".

Well then a simple experiment is in order… Remove the 1 M resistor and see if both frequency and amplitudes (measured with an Extremely low cap probe, I used an HP X100 probe) and measure the input amplitude to the resonator. If the resistor is a supernumerary component then there will be no change I went through this same issue although with PIC’s about 15 years ago when they were new… The issues are most similar although I have read better descriptions of the differences between a (in my case @ 400 KHz) Barium Titanate resonator and a crystal. That generalized bit of fluff left more questions raised than answered. I’m not going to even try removing that part it was placed there because All resonators aren’t made alike and that part helps to “normalize” the amplifier that provides gain required for oscillation, although popping it off and replacing it with a new one is trivial.
Lowering the value produces more drive by lowering the dc input resistance to the oscillator and it’s as likely that the added component is there for impedance matching as it is to meet other Barkhausen Criteria for oscillation.
I learned a different engineering philosophy. This was to use all the parts it takes to make it work and then start pulling parts until it quits… then put that part back. When I got to the real world I found that philosophy wanting a ‘little’. This was when I had to make my creations work to a set of Specifications. An Amplifier has an input impedance a specific max and min gain a specific operating frequency range with limits as to gain flatness over that frequency range and an output impedance that must remain within a specific range over the specified frequency range. I haven’t talked about absolute phase differential over the frequency range or the thermal characteristics of the amplifier over that same range or distortion or gain flatness over the range.
I can tell you that I’ve had to deal with every one of these issues in making an oscillator work and Not a synthesized oscillator or PLL. Over the range most frequently was only a couple of MHz. Audio Amplifiers are subject to the same issues just different frequencies and different issues with not meeting specifications… Although I do remember a 'buddy of mine that built a stereo amp once that sounded great, using either channel but not both. 2 minutes with the schematic after I had heard the outputs of each channel then both started me laughing… This was an experienced engineer with 20 years of time in the trenches who had interchanged the wires on one driver transformer so one channels audio was 180 deg out of phase with the other. looking at the schematic clearly left no other alternative. The indicator aurally was that the low frequencies were being cancelled and the lower the frequency the more the cancellation compared to a single channel became obvious. The quick fix was to reverse the phase of the speaker on the channel with the miswired transformer.
My point is that in order to second guess someone elses engineering like the comment about unnecessary parts… Really requires an understanding of what each part is there for.
The engineering on the Arduino as a whole is minimalistic there aren’t enough power and ground connections for external connection, Especially the ground leads to be able to make good low noise circuitry possible. The 3V3 supply is a joke. on all I’ve looked at all seem to have the same LP2985… It’s at least in the Rev3 just the 3V3 reference for the USB changeover switch and in that application the 1uF cap ‘C3’ might be fine although the National Semi datasheet recommends a min value of 2.2 Uf

**Minimum capacitance is shown to ensure stability (may be increased without limit). Ceramic capacitor required for output (see Application Hints).

and the value isn’t even minimum. The Joke is that someone brought that voltage out for use with 3V3 devices and the real laugh is hidden well. In IIC communications 3V3 busses are common and the wire library properly sets the pins high as required in the spec and when one connects the 2 4K7 pull-ups to 3V3 and then to the SCL and SDA lines the 3V3 supply will now measure 4.3 V.
The 3V3 issue is well known and is easily fixed by either clamping the 3V3 source or using a level shifter that isn’t required… If the IIC ports weren’t written high to supply an active high at the 5V level… but were open collector and the pull-ups managed at each device connected (For capacitive loading compensation) that issue will go away, to return only wnem the bus must be shared between both 5 and 3V3 and then a level shifter is mandatory for all but the simplest of uses.
So much for my rant… I’ve been there and done that long enough to appreciate what it takes to be a successful designer… and today I’m happily retired.

Doc

LP2985.pdf (487 KB)

The inverter within the chip must be biased into the linear region in order to oscillate reliably

Aw, come on. You can build a crystal or resonator oscillator with logic inverters, but the relevant pins on an AVR are specifically supposed to be an oscillator circuit, and there is no reason to assume that it isn't already biased properly (or designed as "not digital"), unless the datasheet or app note specifically says so.

So far the best bit seems to be to pull that needless resistor and see how an Uno performs over the range of 0 to ... 50C I do know that that resistor was a requirement on another chip and it was different for optimum performance and a different value for a TDK resonator VS a Panasonic resonator. Perhaps it was just thrown on the board... Just in case, but I don't think so. It might also be a good idea to increase C3 the 3V3 bypass with a 10 to 22 uF cap (i'd use a 100 to 220 uF but that's me) just to bring it to par with the data sheet?.

Doc

It’s also worth noting that the atmega328 fuse settings used on Uno for the oscillator are somewhat “questionable”, in that it selects the “low power crystal oscillator” whose top clock rate is 16MHz, when perhaps it should be using “full swing crystal oscillator”, which is good for up to 20MHz. Similar settings have been implicated in problems people have had getting the ATmega1284 to work correctly, and I have personally had ATmega8 cpus fail to start up with the “low power oscillator” option (which is NOT QUITE the same as the 328 option) and a ceramic resonator.

westfw:

The inverter within the chip must be biased into the linear region in order to oscillate reliably

Aw, come on. You can build a crystal or resonator oscillator with logic inverters, but the relevant pins on an AVR are specifically supposed to be an oscillator circuit, and there is no reason to assume that it isn't already biased properly (or designed as "not digital"), unless the datasheet or app note specifically says so.

i agree. as mentioned in my last post you can actually measure the internal resistor with a high range ohmmeter. even with a regular voltmeter hooked up to x0 pin w/o crystal its obvious theres one there. half voltage shows the inverter is being properly biased.

fyi i tried something similar to docs suggestion by looking at that output with and w/o a 1meg external resistor. very little change in amplitude. hard to say if it increased or decreased. with much smaller values it does decrease.

Docedison:
I learned a different engineering philosophy. This was to use all the parts it takes to make it work and then start pulling parts until it quits… then put that part back. When I got to the real world I found that philosophy wanting a ‘little’.

the trouble is many in this forum forget its mainly hobby, not medical or other mission critical oriented. highly charged “discussions” result when forum alpha dogs and other naysayers base comments on ego and emotion rather than reason. often innocent bystanders suffer as a result. depending on the client i will spend varying amounts of time reading specs and white papers but for hobby have no problem cutting a few corners.

Docedison:
The engineering on the Arduino as a whole is minimalistic there aren’t enough power and ground connections for external connection,

not minimalistic enough imo. im convinced things like reset circuit, ftdi interface, etc belong off board since they are rarely required in many applications. but i agree about the power & grounds. thats why my favorite homegrown arduino as shown below has a couple rows available for those accessable to each io pin. allows plugging in motors, servos, sensors, etc via industry standard 3 pin connector instead of rats nest or clunky shields. in addition to much lower cost and smaller size, theres a few more io available compared to uno or promini.

Docedison:
The 3V3 supply is a joke. on all I’ve looked at all seem to have the same LP2985…

i agree with that too. there are many cheaper and higher performance alternatives.

Docedison:
In IIC communications 3V3 busses are common and the wire library properly sets the pins high as required in the spec and when one connects the 2 4K7 pull-ups to 3V3 and then to the SCL and SDA lines the 3V3 supply will now measure 4.3 V.

if i understand what you are saying correctly there is no excuse for that. all avrs are capable of open collector/drain operation. its one of the reasons i avoid arduino i2c libraries.

IMG_1097.jpg