Clock Source Selection

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to design a system that will operate fairly consistently over a wide range of temperatures. So far, I've been using the internal RC oscillator that my ATmega324P provides. However I've read that this oscillator is temperature and voltage dependent.

As a solution I'm looking into external crystals. The datasheet for the device refers to everything as a crystal oscillator. Do they, in fact, mean an oscillator with its own power source or will the processor be able to drive a passive crystal?

Thanks!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "crystal oscillator" is one of several clock systems in the AVR that you can select. It is used for attaching one external crystal, and two capacitors, as the clock source. Page 31 ff.

If you want to use an external oscillator (shiny little four-legged box producing a nice square wave signal) then you feed its output to the AVR XTAL1 input, and select "external clock" as clock source in the AVR. Page 37-38.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Don't know what datasheet you are looking at...
From mega16 datasheet:

Table 2. Device Clocking Options Select(1)
Device Clocking Option CKSEL3..0
External Crystal/Ceramic Resonator 1111 - 1010
External Low-frequency Crystal 1001
External RC Oscillator 1000 - 0101
Calibrated Internal RC Oscillator 0100 - 0001
External Clock 0000

Also from same page (p.25)

Quote:
XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can
be configured for use as an On-chip Oscillator, as shown in Figure 12. Either a quartz
crystal or a ceramic resonator may be used. The CKOPT Fuse selects between two different
Oscillator amplifier modes. When CKOPT is programmed, the Oscillator output
will oscillate will a full rail-to-rail swing on the output. This mode is suitable when operating
in a very noisy environment or when the output from XTAL2 drives a second clock
buffer. This mode has a wide frequency range. When CKOPT is unprogrammed, the
Oscillator has a smaller output swing. This reduces power consumption considerably.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

JohanEkdahl wrote:
The "crystal oscillator" is one of several clock systems in the AVR that you can select. It is used for attaching one external crystal, and two capacitors, as the clock source. Page 31 ff.

If you want to use an external oscillator (shiny little four-legged box producing a nice square wave signal) then you feed its output to the AVR XTAL1 input, and select "external clock" as clock source in the AVR. Page 37-38.

Right, but my confusion lies in the terminology. The datasheet, and your reply, imply that I can use a "passive crystal" which means I can put a 2 (or 4) pin crystal on the board with no extra power or control lines, and the AVR will be able to start it oscillating.

I have always heard "crystal oscillator" to refer to a device that contains a quartz crystal but has its own power source (and usually an on/off switch too).

I just want to make sure that I can use a "passive crystal."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I just want to make sure that I can use a "passive crystal."

Yes. You can. That's the configuration described in the appropriately-named section "External Crystal/Ceramic Resonator".

There's even a circuit diagram in your AVR's datasheet detailing exactly how to hook up such an arrangement, along with a discussion of the need to connect your own external loading capacitors.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The "crystal oscillator" is inside the chip and can provide a clock if a "passive crystal" and two caps to GND are connected to XTAL2:1 and proper fuse settings are selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I just want to make sure that I can use a "passive crystal."

For me, the figure on p 31 makes he thing crystal clear...

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]