Crystal question.

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

Tahnkx

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.

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.

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.

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

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.