Pages: [1]   Go Down
Author Topic: Crystal question.  (Read 1245 times)
0 Members and 1 Guest are viewing this topic.
Surat,GJ,India
Offline Offline
Newbie
*
Karma: 0
Posts: 35
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

i have some mega328 and mega8, my question is,
Can i use 20mhz crystal oscillator instead of 16mhz ???

Tahnkx
Logged

Rock it n loop it.

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8821
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not without writing your own Arduino core.  The standard core only works with clock frequencies that are a multiple of 8,000,000 and 1,000,000.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's funny because, a while back, I bread boarded up a project and I didn't have a 16.0 crystal so I tried a 14.74 I had in the parts drawer, and it seemed to clock OK.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8821
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's funny because, a while back, I bread boarded up a project and I didn't have a 16.0 crystal so I tried a 14.74 I had in the parts drawer, and it seemed to clock OK.

If you check carefully you will find that millis(), micros(), delay(), and delayMicroseconds() will be off by various amounts.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Santa Fe
Offline Offline
Full Member
***
Karma: 1
Posts: 201
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is probably so, I never checked since this was just an art project. I'll make sure I have 16.00 mhz for any project requiring accurate clocking.
Logged

Pages: [1]   Go Up
Jump to: