Go Down

Topic: DIY-duino. 20MHz crystal Ok just to get started? (Read 1 time) previous topic - next topic

gonzogeek

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

pluggy

#1
Dec 14, 2010, 03:12 pm Last Edit: Dec 14, 2010, 03:15 pm by stephen_t Reason: 1
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........
http://pluggy.is-a-geek.com/index.html

JanD

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

gonzogeek

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!

Coding Badly


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.

GordonEndersby



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

gonzogeek

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.

Go Up