Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

16 meg crystal, load caps and AVR won't start

16 meg crystal, load caps and AVR won't start

2004-04-28 by Craig Limber

Hi there;

I am looking for a little advice on debugging my latest AVR project.  I
have an ATmega32 (40 pin DIP, high voltage version) on a custom
single-sided printed circuit board.  I bought a 16 meg/20pf load
crystal (CTS Frequency Controls model ats16a) and wired in 18pf caps
(didn't have 20 but I figured stray capacitance should get me close
enough).  The crystal and caps are mounted as close as I could on the
board.  

My processor won't start.  I adjusted the fuses for the high frequency
range and programmed the CKOPT fuse.  I also tried various fuse
settings for SUT0 and SUT1 to see if fiddling with the startup time
might help but no go.  The usual swapping out of all related components
with fresh replacements was the first thing I tried.  I also tried
different makes of 16 meg crystals.

A frequency counter on either XTAL pins shows 15.9989xx MHz and a scope
on either pin shows either a nice sinewave (rail to rail which tells me
that CKOPT is programmed as I expected) on one and a slightly deformed
sine wave on the other (but still regular and rail to rail).  

If I put an 8 meg crystal in it works perfectly using the exact same
settings and load caps.  A scope on the XTAL pins shows almost
identical waveforms at 8 meg as 16 meg but at half the frequency, of
course.

Oh, and I am using a 16 meg version of the ATmega32.  Power shows 5.01
volts and the microcontroller and all other bits have .1uf bypass caps.
A scope on the other pins and on power doesn't appear to show any noise.

I tried swapping the load caps ranging from 15 to 22pf but still no 
joy.  I tried swapping processors and I've verified the settings and
whatnot using an STK500 just to be sure.  

When on the project board I use ISP from Linux.  When the 16 meg
cyrstal is in use and the CPU is programmed to use it as described
above I can't even use UISP or avrdude to reliably read the fuses
or program the chip.  Just by lowering the crystal from 16 to 8 meg
re-established full communication.  Each time I wanted to try new
fuse settings while the 16 meg crystal was installed I had to remove
the chip, program it elsewhere and put it back on the project.

So, any suggestions of what to try next?

Thanks in advance, eh.

Craig

Re: [AVR-Chat] 16 meg crystal, load caps and AVR won't start

2004-04-28 by James Wagner

Craig -

It almost sounds like you have too much capacitance on one
(or more) of the crystal lines. The oscillator's input
terminal is the most sensitive.

Do you have anything else connected (that is, are you also
using the clock signal elsewhere)? 

Are you, perhaps, using one of those plug-in
"proto-boards"? They have lots of C on every pin.

Have you tried high amplitude oscillator setting?


Jim Wagner

Make the most out of Apple's innovative technologies
http://developer.apple.com/wwdc/applelinks.html
---------------------------------------------------------------
---------------------------------------------------------------
The Think Different Store
http://www.thinkdifferentstore.com/
For All Your Mac Gear
---------------------------------------------------------------
---------------------------------------------------------------

Re: [AVR-Chat] 16 meg crystal, load caps and AVR won't start

2004-04-28 by David VanHorn

At 10:10 AM 4/28/2004 -0600, Craig Limber wrote:


>Hi there;
>
>I am looking for a little advice on debugging my latest AVR project.  I
>have an ATmega32 (40 pin DIP, high voltage version) on a custom
>single-sided printed circuit board.  I bought a 16 meg/20pf load
>crystal (CTS Frequency Controls model ats16a) and wired in 18pf caps
>(didn't have 20 but I figured stray capacitance should get me close
>enough).  The crystal and caps are mounted as close as I could on the
>board.  

AARRGGHH..  While 18pF will likely run, you're closer to needing 35.
http://www.dvanhorn.org/Micros/All/Crystals.php
Sorry, it's a pet peeve.

>My processor won't start.  I adjusted the fuses for the high frequency
>range and programmed the CKOPT fuse.

CKOPT is not something you want to mess with.
High speed crystal, and CKOPT not checked (1, not programmed)


>A frequency counter on either XTAL pins shows 15.9989xx MHz and a scope
>on either pin shows either a nice sinewave (rail to rail which tells me
>that CKOPT is programmed as I expected) on one and a slightly deformed
>sine wave on the other (but still regular and rail to rail).  

Normal. 

>If I put an 8 meg crystal in it works perfectly using the exact same
>settings and load caps.  A scope on the XTAL pins shows almost
>identical waveforms at 8 meg as 16 meg but at half the frequency, of
>course.

Ok, are you getting near rail-to-rail amplitude?
If it's low (1-2Vpp) then change CKOPT and watch it start running, and then never mess with that fuse again. 

CKOPT selects a very low power "Vittoz" oscillator, that is VERY touchy.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.