 |
By: sammydee (offline) on Saturday, May 17 2008 @ 10:12 PM PDT (Read 5461 times)
|
|
|
sammydee |
| sammydee |
|
I've made almost a dozen projects using your Minimalist Targetboard and more recently the Business Cards. All of them have used the AVR's internal oscillator.
Until now. And so...new problems. 
At MakerFaire I bought an Arduino Diecimila and have been playing with it. It's a very nice board, with lots of pros and cons when compared to the Business Card. I can see a place for both in my future projects...with Arduino seems preferable for things that will be connected to a "real" computer, while the Business Card approach seems preferable for low power projects.
I was experimenting with getting a serial connection running between a Business Card (internally clocked) and the Arduino, and had quite a bit of trouble getting data through reliably. I know that the internal oscillators in the AVRs are usually not considered accurate enough for serial communication, so I figured I'd add a crystal to the Business Card.
SO...a trip to Jameco later, we had:
325201CE CRYSTAL,12.000MHZ,HC49/US,20PF 4 .4600 1.84 05/19/08
15405 @ CAP,CERM,DISC,22pF,50V,20% 20 .0760 1.52 05/19/08
Yes, I see that the crystal says it needs 20pf caps and I bought 22pf. I was hoping that was close enough, as I couldn't find a closer match for parts that were available and available in small quantities.
SO, I soldered in one crystal and two caps into the obvious spots in the Business Card; went into the Makefile for my project and switched lfuse from 0x62 to 0x60 (per what I think the online fuse calculator said to do), and did a "make install".
And now the board's dead. 
Was I silly in thinking that the 20/22pf issue wasn't a big deal? Did I get the wrong type of crystal? Have you used crystals instead of the onboard oscillator in your projects, and if so what crystal/caps did you use (and what fuse values)?
Naturally, simply changing the fuse value back and doing another 'make install' isn't working. Is there a good way to resurrect the chip, or should I throw it away?
So many questions...thanks for all the fun! ...Sam
|

Apprentice
Status: offline
Registered: 05/14/08 Posts: 7
|
|
|
|
|
 |
By: sammydee (offline) on Saturday, May 17 2008 @ 10:43 PM PDT
|
|
|
sammydee |
| sammydee |
|
Well, it seems that writing about your problems helps you fix them. Or something.
The problem was the fuse bits. Lfuse should have been 0x7f, not 0x60. Setting them to 0x60 says that the chip wants clock pulses provided on Xtal1, with Xtal2 disconnected. NOT THE SAME as connecting a crystal to Xtal1 and Xtal2. D'oh. (I should have scrolled through the entire list in the online calculator...)
I put another Mega168 into the board, set lfuse to 0x7f, and things are running just fine.
I don't know yet if any of this fixed my serial problems, but at least now I know how to configure the Business Card with a crystal. The part numbers might be useful for others trying this for the first time, so I'll leave these posts here in the Forum.
As for recovering the broken Mega168 ... this post gives a cute way to recover:
http://www.larsen-b.com/Article/260.html
I'll try that ... later.
Thanks again for all the fun! ...Sam
|

Apprentice
Status: offline
Registered: 05/14/08 Posts: 7
|
|
|
|
|
 |
By: sammydee (offline) on Saturday, May 17 2008 @ 11:12 PM PDT
|
|
|
sammydee |
| sammydee |
|
(By the way, switching to the crystal made my serial problems all vanish. Hurray!)
|

Apprentice
Status: offline
Registered: 05/14/08 Posts: 7
|
|
|
|
|
 |
By: Windell (offline) on Saturday, May 17 2008 @ 11:20 PM PDT
|
|
|
Windell |
| Windell |
|
Okay I just wrote a full response before seeing what you updated (doh!)-- part of it's below.
Your chip is probably fine and rescuable, but I'd set it aside until you figure out how to rescue it.
I don't know that particular oscillator-- it isn't one that I've used, and I'm not sure without careful study whether it would qualify as a "low power" or "full swing" oscillator. The caps are probably fine, so wouldn't worry about that.
When set to "external clock," you need to provide the full clock signal going to that pin before you can talk to the chip and reprogram it. The external signal should be applied to pin XTL1, with XTL2 left unconnected. Now... where to get a clock signal that you can input to the chip? From another AVR, of course. Program the CKOUT=0 fuse bit on another one in order for it to output its clock output on the CLKO pin and wire that (along with a common ground) to the clock input (XTL1) of the chip that you're going to rescue.
Also remember: your Arduino can be used to be that extra AVR that will rescue your one on the card.
When you're ready to try again with the new crystal, keep in mind that you have a "low-power" oscillator on the Arduino board that you can use as a reference-- you could even try programming a chip in that, then taking it out to run with your new crystal.
Windell H. Oskay
drwho(at)evilmadscientist.com
http://www.evilmadscientist.com/
|

Evil Scientist
 Status: offline
Registered: 06/15/06 Posts: 1932
Sunnyvale, CA
|
|
|
|
|
 |
By: sammydee (offline) on Sunday, May 18 2008 @ 12:50 AM PDT
|
|
|
sammydee |
| sammydee |
|
Thanks again for all your advice and help. ...Sam
|

Apprentice
Status: offline
Registered: 05/14/08 Posts: 7
|
|
|
|
|