22 mhz on an atmega168

ok i was trying things out and was wondering what running an atmega on 22mhz would long term or even short term..

What i did was set one up on a breadboard with the blink running (decimillia bootloader burnt on fresh using arduino 11 and parallel programmer), and it was blinking away happily all night powered from a usb power cable i made for it (usb direct to chip pins 7 and 8, 20 and 22 with capacitor), set the 16 mhz and caps up to pins 9 and 10 (all pins are referring to the chips pinouts). it blinked away happily all night and never hot warm. it was stone cold and blinking away in the morning too, good running :) so i swapped the 16 mhz for a 22 mhz. it appeared to work fine. just blinked faster i think.. So i burned on a new sketch, the simple servo mover (the one that moves it back and forth) and it ran fine on 16 and then on 22.. didnt bother it, nor did the chip warm up..

would using 22 on it as it is now be ok? or should i stick with the 16 or lower? (i tried a 7 mhz oscillator too and it was ok on the blink, am yet to try it on the servo sketch).

just looking for feedback and discussion on this :)

(edit) thru further investigation i do see the difference in the distance the servo travels with different crystals. so it may be ok in some applications to have faster or slower crystals but not wen servo timing is concerned :D. even the 16.93 mhz one i tried had a significant change in the throw)

It should be fine at 22MHz, but you don't get to bitch if it breaks because that's beyond spec ;)

I've heard of them being pushed as far as they'd go.. apparently that one started getting corrupty around 35MHz

(edit) thru further investigation i do see the difference in the distance the servo travels with different crystals. so it may be ok in some applications to have faster or slower crystals but not wen servo timing is concerned :D. even the 16.93 mhz one i tried had a significant change in the throw)

The Arduino core library has some hard-coded crystal frequency-related code in it--I had thought there was a page on the wiki about it but if there is one I couldn't find it.

Here are a couple of forum posts discussing what would be affected: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1192142344, http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1195698299

Not that I'm suggesting it's wise to overclock an ATmega :) but if you're going to do it it should be possible to get more useful operation from it with a modified Arduino core.

--Phil.

There are some notes here: http://www.arduino.cc/en/Hacking/OtherHardware

thanks that some useful input :) i'll try changing the clock settings, reburn the sketch, and see what happens. i'll compare it with 16 mhz seeing as thats the 'Control hamster' :P

Chiming in with personal experience, with a crystal or resonator, you can run the core stably at up-to about 30MHz (at 5 volts), after that the clock circuitry doesn't drive the crystal so well. If you have an external clock source or oscillator, it may be possible to push it beyond that.

Bottom line: Unless it's mission critical, 22MHz should be well within the Atmega's ability, you may need to fudge with the caps on the crystal though.

There are some notes here: http://www.arduino.cc/en/Hacking/OtherHardware

Ah, I knew there was something! Unfortunately I was searching for the words "crystal" or "frequency" and thus didn't find it...

--Phil.

this will help me in future wen i make more permanent circuits for things :)

i stuck with the 16 mhz for now, but at least i know my options :) I made a simple field servo tester for my RC planes that swings 90 degrees (45 each way from center) using the servo move sketch for now, but wil replace the sketch with a better one later (added a ICSP socket to the board)