Overclocking microcontrollers


We’re all familiar with overclocking desktop computers; a wonderful introduction to thermal design power and the necessities of a good CPU cooler. [Marcelo] wanted to see how far he could overclock a microcontroller – in this case an ATMega328 – and ended up with a microcontroller designed for 20 MHz running at 30 MHz.

To verify that his uC could run at higher clock speeds, [Marcelo] began his experiments by uploading a piece of code that toggled a few pins as fast as possible. He needed to upload this code with a common 16 MHz crystal – AVRDude simply won’t work when a chip is clocked at higher speeds.

After successfully demonstrating his microcontroller will turn pins on and off at 30 MHz, [Marcelo] wanted to see if he could do something useful. By editing a single setting in his Arduino boards.txt file., [Marcelo] was able to have his overclocked microcontroller read and reply to characters sent over a serial connection. It worked, demonstrating an overclocked microcontroller could be useful in some situations.

As for what [Marcelo] plans to do with his faster microcontroller, he’s thinking of improving a ATMega-powered VGA color generator. A higher clock speed means he can push more pixels out to a VGA monitor.


  1. rasz says:

    This is pretty LOLworthy. Iv seen 72MHz STM32 chips clocked up to 160MHz

    • mistress says:

      Best I have done is up a 486dx to 999Mhz. I was too afraid to let it run for more than 30 seconds or so. The CPU itself didn’t fail but lit some other stuff on fire and I burned myself for good measure.

      • Pun says:

        I once overclocked a Z80 to 600 GHz.

        • mistress says:

          I smell sarcasm. Clearly you are not old enough to remember hardware overclockers that overrode the ‘turbo’ feature, most of which would let you set whatever frequency you wanted up to three digits. Stuff got lit and I had to pull my coveted overclocker off in a hurry, thus the burns.

          Technically you could attach an oscillator up to a z80 to supply 600Ghz, that does not mean it will work, just like the 486 – but ~1.5 Thz oscillators are easier to source.

          • msalko says:

            You mean puting your finger between contacts of rezistor on cheap clock replacement? I build small 8bit pc with z80. How i like smell of burned 8kb eeprom at the morning.

  2. lgrunenberg says:

    isnt the ram and rom the part of the uC that doesnt allow higher clock rates than specified? i tried overclocking an atmega328 and over about 24mhz the sram cant be read back reliably.

  3. grapsus says:

    It can be handy in some situations (mostly timing related) but there is a reason why chips were rated at a certain speed. I’ve seen AVR do all sorts of crazy stuff when overclocked. They may still togle pins, but some hardware will not work properly, like the uart missing bytes. Also higher voltages allow stable operation at higher speeds.
    It’s cool for hacking purposes, but I certainly wouldn’t overclock a micro in a real product.

  4. alxy says:

    It’s fairly well understood that the core of an AVR can be overclocked without much problem. There’s a youtube video of someone pushing one to 51mhz. Where things fail is in the ADC and EEPROM. Those components (especially the ADC) don’t like anything over 16mhz. You might be lucky to push 17 or 18mhz. A vga video generator will overclock ok, but if you have to read anything analog or persist data then you’re back to 16mhz.

  5. biozz says:

    i have been doing this for years (ok just 2) on by flashy business card with a cheap MC … it was not to bad when i did it on that as i programmed it in ASM but when im doing it in c or anything of that sort i have to do all the calculations ahead of time so i know what delays, bauds, exc to use
    or use a crystal that divides evenly

  6. asdf says:

    Most microcontrollers can be overclocked, but there’s a reason they’re only rated for a particular clock frequency range. How the chip behaves when exceeding its specifications is anyone’s guess, and can vary depending on operating conditions, production batch and phase of the moon.

  7. Jenci says:

    Has anybody overclocked MSP430F5/6x 20MHZ models up to higher frequencies ?

    • Kaz says:

      I assure you, if the chip exists, someone has overclocked it :) But just try it yourself and see what you find. Odds are most of it will work, but some peripherals will stop functioning sensibly sooner than others.

  8. jc says:

    I very much wonder how well a SAM7S series chip could do, given that nice PLL inside

  9. Charles says:

    Yeah, I did overclocking of an ATMega168 http://cnlohr.net/random/Circuits/AVROverclock/graph.svg and it did exceptionally well. I only tested the UART, multiplier and that the core was up and running… but they don’t seem to miss a beat. I actually used one clocked at 40 MHz for a project a while back, no problems.

  10. Jose Torres says:

    As pointed out above, the usual warning that goes along with telling someone they can overclock a CPU is to tell the user that this may lead to a unstable operation and should never be used in a safety critical environment. We should bring out the watchdog timer tutorial and test the theoretical operating limits for each model and silicon die manufacturer.
    Hint: Generally, the CPU can be clocked way outside the specified norm as evidenced with this article.
    This is the root seed idea for a new competition.
    Please promote attribution.

  11. Miroslav says:

    With PIC 16F874A rated at 20 MHz max, 30 MHz worked well for me. No problems.

  12. willaim says:

    Does the power consumption go up linearly?? how much more does an over-clocked chip heat up??

  13. Badass Bandanaman says:

    does it run crysis now?

  14. bothersaidmayans says:

    I’ve overclocked 12F675′s before to 27 MHz for generating video signals..

  15. Mike Bradley says:

    In my oLogic project, I overclocked a PIC18F26K20 from 16MHz xtal to 24MHz xtal, and used the internal x4 multiplier for 96MHz. The chip was speced to 64MHz. I have never had an issue doing this. I also have the overclocked chip in a comercial product, works extreamly well, and is one of my favorite chips for its speed. And yes, the PIC is 4 cycles per instruction, but its internaly 96MHz, and /4 for a 24MIPS

    Here it is in an open project:

  16. NewCommentor1283 says:

    lol noone mentioned the fact that there are
    (or more?)

    there are 8MHz, 16MHz, and 20MHz AVR chips.

    the 16MHz ones go to about 20 or 25MHz
    im pretty sure these are the ones used in an arduino

    and its the 20MHz one he is overclocking at 30MHz

    and i quote:
    “microcontroller designed for 20 MHz running at 30 MHz”

  17. Jovan says:

    You don’t need to overclock an AVR, to get higher processing speeds. You just need to ditch that pathetic Arduino and start coding in Assembly.

  18. Sjamaan says:

    I did that with an Arduino Uno to get it to use Jaromir Dvorak’s AVGA lib last year…you had to switch the 16MHz crystal in and out with the 30MHz one to for the usb to work and flash the hex…but it worked perfectly….pic on my blog of it working…

  19. JCooper says:

    Hi all,
    Everyone seems to just talk about increasing the Xtal frequency. What about increasing the voltage to the chip, let;s say 6V and superglue a small heatsink to the MCU, then put in the XTAL. This seems more the way to go, don’t you thin?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s