Go Down

Topic: Crystal question. (Read 1 time) previous topic - next topic

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

Tahnkx
Rock it n loop it.

johnwasser

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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

RPCoyle

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.

johnwasser


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.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

RPCoyle

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.

Go Up