Atmega External Crystals...

Long story short.

I burnt a 20mhz bootloader onto my attiny85, it worked, but then it stopped working completely, so I placed
a 20mhz crystal as explained and the smallest ceramic caps i could find!

Still dead, So I went out to jaycar, picked up 2 27p ceramic caps, placed them in series with the outputs of the crystal and into the 2 pins, viola it all works!

Great, but my damn annoying inquisitive side of me nature springs alive!!!... So i've been sitting here for 20 minutes wondering how it works!

A voltage is passed to the crystal and turned off, the crystal then UN-distorts back to it's original shape sending out a pulse, how does that affect the capacitor and the roles they play back to the Arduino Pins that have the xtal across them?

what precisely is going on here, I took my multimeter and switched to hertz, placed one probe on one of the crystal pins, and then the other to ground and I got the arduino doing ever increasingly slower osccilations until it hit around 2 - 1 hz and it crashed :slight_smile: - reboot later the might attiny85 was back!

i'm trying to imagine how the electrons pass both in and out, anyone know a windows circuit emulator which shows the current / voltage path of the electrons like AllCircuits i think it's called for Android? but in Windows? - there's no crystal to select from sadly, i need a more complex designer...

Thanks... (in other words, how does the crystal do it's job and what are the role of the caps, i've googled it, it just made it worse)

I believe this is involved in the process.

A voltage is passed to the crystal and turned off, the crystal then UN-distorts back to it's original shape sending out a pulse, how does that affect the capacitor and the roles they play back to the Arduino Pins that have the xtal across them?

The crystal doesn't merely "un-distort", it "rings" like a bell, at a particular frequency. Like a plucked violin sting.
This gradually dies out without further stimulation, but if you were to operate at electronic speeds much faster than the oscillations themselves, you could detect the peaks of the ringing, and add additional energy at just the right times to keep the crystal vibrating at the same frequency (rather like the bow of a violin.)

At least, that's how I visualize it.

The crystal oscillator operates at such low power levels that connecting a multimeter or any other garden-variety instrument to the oscillator pins will likely stop the oscillator, or at best, throw it waaay off.

Thanks... (in other words, how does the crystal do it's job and what are the role of the caps, i've googled it, it just made it worse)

There are tons of reference works on how crystal oscillators work. An oscillator is simply an amplifier with positive feedback applied from it's output to it's input. The amplifier portion is internal to the AVR chip. If one uses a series crystal in the feedback path of the amplifier, then positive feedback voltage will only be applied at the specific resonance frequency of the specific crystal being used, forcing the amplifier to oscillate at only the frequency of the crystal. The frequency that a specific crystal is resonate at is determined mostly by it's physical properties (thickness, cut type) but also the circuit capacitive it is wired into. The external padding caps used with a crystal is a designers attempt to match the 'load capacitance' that the crystal was designed to work at to give the specific frequency the crystal was designed for. Change the caps slightly and the frequency of the circuit will change slightly, remove the padding caps altogether and the oscillator may still continue to function but just at a frequency somewhat removed from the marked frequency of the crystal. The manufacture of the crystal defines (in it's datasheet) what 'load capacitance' the crystal was designed to work at to meet the frequency +/- tolerance marked on the crystal.

lefty

Still dead

If your avr is configured for full range crystal, it should have no problem working with 20Mhz crystals: those crystals are very easy to start.

Crystals are simply a l/c tank: it consists of serial inductor / capacitance / resistance. The oscillator itself has negative feedback (it is an inverter / NAND gate). The crystal oscillates by providing a phase shift so that the whole negative feedback loop becomes positive feedback.