External crystal oscillator

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

Hi out there?

I would be very happy if anyone can give me an answer or point me in the right direction to find an answer to my question! I have tried google to find it, but without any luck so far :-(

If you use an external crystal oscillator, the output of the "metal can" should be connected to XTAL1 and Gnd, and the correct fusebit to be programmed. Then my question, can the other pin "XTAL2" be used as a general purpose input/output pin?

The reason why I ask is an existing design running internal RC oscillator and using USART. This gives us trouble with the communications, even if the RC oscillator is calibrated. The design uses XTAL2 as an output, and XTAL1 is unused, so I want to modify the board with an external crystal oscillator, just add 3 wires, change fusebits and we are "on the road again"! I could of course just try and se if it works, but I would like to have it documented if it's possible or not.

 

I have not been able to find anything about this, perhaps one of you know where I can have a look or an answer?

 

Thanks in advance and best regards

Karl Jan

 

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

kasko wrote:

If you use an external crystal oscillator, the output of the "metal can" should be connected to XTAL1 and Gnd, and the correct fusebit to be programmed. 

 

Not sure what data sheet that is in, but the data sheet for the mega328p shows the 2 leads of the crystal going to XTAL1 and XTAL2.

 

Keith.

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

kasko wrote:
I have not been able to find anything about this, perhaps one of you know where I can have a look or an answer?

Did you tell us what microcontroller you are working with?

 

kasko wrote:
If you use an external crystal oscillator, the output of the "metal can" should be connected to XTAL1 and Gnd, and the correct fusebit to be programmed.

What would an AVR8 datasheet say about that?

 

Now, if you use a "clock module" with a single-pin output, then indeed you can free up XTAL2:

Whi

Which might be one of these, perhaps?  http://cds.linear.com/docs/en/da... Dunno; never used one.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Thu. Apr 20, 2017 - 07:37 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for feedback!

According to the Fig. 8.4, this should be possible....

I have ordered some crystal oscillators and I'll try it!

 

Thaks again!

 

Karl

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

kasko wrote:
If you use an external crystal oscillator, the output of the "metal can" should be connected to XTAL1 and Gnd, and the correct fusebit to be programmed. 

That's for an active crystal oscillator - not just a crystal

Image result for crystal oscillator

Image result for crystal oscillator

 

 

Artandsparks wrote:
Not sure what data sheet that is in, but the data sheet for the mega328p shows the 2 leads of the crystal going to XTAL1 and XTAL2.

That is for just a crystal.

Image result for crystal oscillator

 

EDIT:

 

More on the difference between a plain crystal and a crystal oscillatorhttps://e2e.ti.com/support/micro...

 

#CrystalOscillator

 

Last Edited: Wed. Jul 12, 2017 - 06:43 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
That is for just a crystal.

Yeah--but what does the AVR datasheet say?  See the paste in #3 above, "Figure 9-2"...

 

[DigiKey appears to take your approach, not Atmel's -- product selector categories are Crystals and Oscillators under Crystals,Oscillators,Resonators]

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Mon. Apr 24, 2017 - 08:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes - the datasheet wording is, well, "unfortunate"

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

kasko wrote:

Thank you for feedback!

According to the Fig. 8.4, this should be possible....

I have ordered some crystal oscillators and I'll try it!

 

Make sure you get ones spec'd for the same Vcc as the AVR, and there is a choice of CMOS and Clipped Sine on Oscillators, as well as MEMS Oscillators with moderate precision.

Clipped sine ones tend to have lower powers and higher precision, and their price is falling to the realm of CMOS oscillators. (driven by volumes of GPS etc)

Clipped sine one cannot connect as Fig 8.4, but CMOS ones can.

 

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

I've always thought that the Atmel data sheet reference to "crystal oscillator" was referring to the internal oscillator that drives the external crystal...

David (aka frog_jr)

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

 if you use a "clock module" with a single-pin output, then indeed you can free up XTAL2:

Depending on exactly which AVR you are using!  Some (older?) AVRs do not have GPIO registers connected to the XTAL pins, which means that using an external clock generator, or the internal RC clock, doesn't give you any extra IOs at all (ATmega32, as one example.)

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

frog_jr wrote:

I've always thought that the Atmel data sheet reference to "crystal oscillator" was referring to the internal oscillator that drives the external crystal...

That's how #3 shows it,  and they use the words External Clock Drive, for External CMOS Crystal/MEMS Oscillator Module use.

You could AC couple a Clipped Sine External Oscillator into XTAL1, with device set for 9-2 operation in #3

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

frog_jr wrote:

 

I've always thought that the Atmel data sheet reference to "crystal oscillator" was referring to the internal oscillator that drives the external crystal...

Who-me wrote:
That's how #3 shows it,  and they use the words External Clock Drive, for External CMOS Crystal/MEMS Oscillator Module use.

Indeed they do.

 

But they use the words "Crystal oscillator connections" (figure 9-2) to describe the connection of an external passive crystal resonator.

 

I can see what they're getting at, as you say, but it is very clumsy and could easily be mis-read by someone wanting to know how to connect an external crystal oscillator - as theusch hinted.

 

 

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

awneil wrote:

 

But they use the words "Crystal oscillator connections" (figure 9-2) to describe the connection of an external passive crystal resonator.

 

I can see what they're getting at, as you say, but it is very clumsy and could easily be mis-read by someone wanting to know how to connect an external crystal oscillator - as theusch hinted.

Well, yes.

Better may have been a slight wording variant like 

9-2: Oscillator connections when using Crystal or Resonator

 

8-4: Connections when using External CMOS Oscillator

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

I'd say better wording would be

9.2 Crystal or Resonator Connections

Because what it's showing you is how to connect an external crystal or resonator! 

 

8-4: Connections when using External CMOS Oscillator

No, that would not be helpful, because it is not specific to just CMOS oscillators.

The existing description is perfectly adequate here - it applies to any for of external clock signal.