Pages: [1]   Go Down
Author Topic: 16.0083 MHz crystal with Atmega8  (Read 1515 times)
0 Members and 1 Guest are viewing this topic.
Bangladesh
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am a newbie to arduino and to the microcontrollers too. I am trying to build a cheap Arduino NG clone on a breadboard with atmega8, purely for educational/learning purposes. I seem to get everything right up to this point, using another Atmega8 with V-USB (http://www.obdev.at/products/vusb/index.html) for USB UART bridge, and everything else. The problem I have now is that surprisingly I can't find any 16MHz crystals on any local store.. I have 4MHz, 8MHz, 12MHz and the closest I got is marked 16.0083 MHz. So, can I somehow use the 16.0083 MHz crystal  and live with that? Can I do this with default bootloader for NG or would I have to compile one with different F_CPU value? And if I do that, would I be able to upload sketches with the UART bridge or use the UART for communicating with any PC while running the sketch?

Any help will be appreciated.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use that, your system will just run a little fast - 0.05% fast. You _may_ notice some affect if you are running high speed RS232 comm's. Everything else is based off the system clock, such as SPI and I2C, so everything else will just sync to that.

Go to www.dipmicro.com & order some 16 MHz crystals, 22 pF caps, 100nF caps, 10K resistors, be ready for your next experiment. Inexpensive shipping too.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Bangladesh
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the reply. So, would I need to recompile the bootloader with new F_CPU or just use the original one?

Also, I cannot order online as I live in a country where most shipping services either never reach or take ridiculously long time. I got all the caps and resistors already, only the crystal got me. But if I wait a I might be able to get correct crystals when the local stores replenish their stocks. But I don't know how long that will take.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 548
Posts: 27372
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Bangladesh? Sorry, I didn't notice that.
https://www.cia.gov/library/publications/the-world-factbook/geos/bg.html
I would have guessed you'd be able to purchase from India rather quickly.  Reality says otherwise I guess.

You could live with the marginally faster speed as is. I really doubt the 0.05% difference will be noticable.
If it is, adust the boards.txt entry, will get pulled in when your sketch compiles.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Bangladesh
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks. Going back to the breadboard now. smiley
Logged

Pages: [1]   Go Up
Jump to: