Arduino Forum

Forum 2005-2010 (read only) => Hardware => Development => Topic started by: gonzogeek on Dec 14, 2010, 02:11 pm

Title: DIY-duino. 20MHz crystal Ok just to get started?
Post by: gonzogeek on Dec 14, 2010, 02:11 pm
Hi

I wanted to breadboard an Arduino today and must rely on my local Maplin (eg RadioShack) for some parts. I've checked stock online and the only suitable crystal oscillator modules they have are 20Mhz. Can I use this for now just to get up and running?

They also have 4, 10, 6, 3.579 (!) MHz crystals but not in U4 style case. Would one of these be better?

Thanks
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: pluggy on Dec 14, 2010, 03:12 pm
It depends on if you're using anything that is timing critical (like serial or programming it on the breadboad). See if they have a 16 Mhz ceramic resonator, a better substitute than a 20 Mhz crystal.  (you don't need the capacitors either).  You tweak the legs a bit to fit a breadboard........
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: JanD on Dec 14, 2010, 03:17 pm
I'm not 100% shure but I think you only need to change
-----.build.cpu_p.16000000L

in the boards.txt file.

Change "-----" to the name of your Arduino and 16000000L to the frequency of your crystal in Hz.

I can't check if this is right because I'm not sitting on an computer with the IDE installed.

But I'm pretty shure you can change the frequecy of the Arduino, How would other wise the Arduino Pro be available in a 8MHz version?

Jan
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: gonzogeek on Dec 14, 2010, 04:11 pm
Thanks.

Craplins only have a 4MHz ceramic. My ATMega328 came with a bootloader burnt in already. I read a post that suggested the bootloader code hardwires the clock frequency so would I need to flash a new bootloader too?

Darn it! Maplins do a 16MHz crystal they just have none in stock!
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: Coding Badly on Dec 14, 2010, 08:03 pm

Theoretically, you can use the existing bootloader.  You just need to adjust for the difference...

20 / 16 * 57600 = 72000 baud

Change the upload speed to 72000 baud.
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: GordonEndersby on Dec 14, 2010, 11:10 pm


Maplins arnt the best for range of parts but if you order a few crystals or resonators from the website it should be with you next day in a small jiffy bag. There mail order is probably there best service.
Ive ordered up to 6pm in the evening and had the parts the next day.
But the earlier in the day the better.

Gordon
Title: Re:  DIY-duino. 20MHz crystal Ok just to get started?
Post by: gonzogeek on Dec 15, 2010, 12:21 am
I decided not to be so impatient in the end and order what I really needed from Farnell. Wednesday will be breadboard fun day huzzah!

Maplins aren't so bad no I was being a bit mean although delivery is normally day after next for me for some reason.