9.216MHz Crystals

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

Hey guys,

I bought some crystals, some 9.216MHz crystals. I wasnt thinking of it at the time but when I got them I noticed 9.216MHz wasn't a standard crystal value in Eclipse IDE, whatever I put in the value myself but the timing is completely off.

Any ideas? I thought for sure I have used 9.216MHz crystals before, but I guess not. Are these crystals for something else? why are they not on the standard crystal lists?

So I thought perhaps they are standard for some other application or somthing. Just wondering, its not really a problem I have tons of other crystals. I just found it odd.

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

I don't know what the freq is commonly used for, but it still gives 0% baud rate error for common UART baud rate speeds.

JC

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

thats why I bought them. But like I said before; even with the xtal selection overwritten with 9216000 the timing is way off.

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

Is it off by a factor of 3? If so perhaps check fuse settings, load caps, and if full swing disable that. This assumes the clock is wrong freq.

It all starts with a mental vision.

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

I would have said is it off by a factor of 0.868?

If so it would imply that the micro was running on an 8 MHz internal RC Oscillator, instead of the external Xtal.

Also, don't forget many of the micros have a divide by 8 fuse for the clock. That will really slow things down a bit.

I'd suggest that you flash an LED once per second, and count them for a minute, to determine the approximate clock frequency you are running at. That will help to determine the cause.

If you are using Windows and AVR Studio it is easy to check the fuse settings and make sure they are set for an external crystal, without the divide by 8 fuse enabled, (assuming you have an AVR ISP mkII, Dragon, STK500, etc.).

Be sure you set the fuses for an external full swing crystal, NOT for an External Clock.

JC

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

No its none of that; I have been working with AVRs to long to not double check that. I cant explain it. If the crystal is indeed just like any other crystals out there, then perhaps I got a bad batch (I only bought 4 of these I think; it was with an order of multi sizes each about 4 or 5 plus other parts).

Thanks anyhoo.

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

Borrow the o'scope, hook it up to the XTAL2 pin of your Eclipse IDE :lol: and see what frequency you've got.

Warning: Grumpy Old Chuff. Reading this post may severely damage your mental health.

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

Put in an 8 or 10MHz crystal and confirm that IT gives the correct timing (for the crystal frequency). If so, then it's likely to be a bad or mismarked 9.216 crystal.

EDIT: Make that 6 or 10MHz. If you ran an 8MHz and were running on the internal oscillator you wouldn't know. Yes, I know you say you're not, but...

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

More likely it's compiled to the wrong oscillator divider, since it's not an Eclipse standard value. Calculate what it should be by hand, then check the output code to see if it matches. It shouldn't be hard to find the place where it writes to the baud rate register just by searching the hex file. Then if it's wrong you can patch it to the proper value with a text editor.

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

peret wrote:
More likely it's compiled to the wrong oscillator divider, since it's not an Eclipse standard value. Calculate what it should be by hand, then check the output code to see if it matches. It shouldn't be hard to find the place where it writes to the baud rate register just by searching the hex file. Then if it's wrong you can patch it to the proper value with a text editor.

The selected CPU speed is not like Arduino where it creates a baud for you. It simply sets the F_CPU in the makefile. The baud calculation is the same I have always used. (in PN or Eclipse; same thing. Eclipse is nothing more then an IDE; it does not generate code or anything of that nature. Its just a more advanced PN :) basically..)

The specific atmega i tested it with is set to 8+ xternal no divider. So when I pop the 9 out and stick in say a 14 and adjust the F_CPU selection; it compiles and works correctly.

So that tells me its not a baud calculation error nor a F_CPU set wrong issue. Because both speeds are 8+ I dont need to adjust to swap; I just yank it out.

if I get down time I will stick it on and burn the fuses to a divider and have it flip a bit; then stick my logic analyzer on it; just to see about what value i get...

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

Well in fact the 9.216MHz is quite standard, as it divides nicely to UART baud rates, RTC timekeeping, and 48kHz audio. I think have not used such frequency with an AVR though.

But do you know the specifications for your crystal? The AVR works best with fundamental mode AT-cut crystals manufactured for parallel resonant operation at some specific load capacitance which the circuitry (load capacitors, AVR pin capacitance plus stray capacitance) must provide. However I have not seen range of operation for other parameters like crystal maximum ESR rating, but usually a crystal just works or then it has serious problems running at all.

Based on the low frequency of the crystal, I guess it is a fundamental mode crystal, not harmonic overtone. Even if you have wrong load capacitance or the crystal was meant to operate in series oscillator circuit, it should still work and the actual frequency would be very close to the specified frequency.

So maybe it is of wrong cut or has too large ESR to work with AVR at all.. I have seen a few bad crystals in a batch but not whole batch of them. They do not like shocks or ESD events much.