Thursday, November 28, 2013

Make Your Arduino Uno Runs 25% Faster

Your Arduino Uno comes with 16 MHz crystal, thus it runs at nearly 16 MIPS (since most of instructions are executed in single cycle). As you might know, Arduino Uno utilize ATmega328 MCU from Atmel. One obvious fact that strangely most of ordinary Arduino users don't know is that the MCU's top speed is actually rated at 20 MHz, not 16 MHz! 16 MHz is official speed limit of MCU used in early version of Arduino, ATmega8 (up to Arduino NG and Severino). Carried on with this obsolete limit, Arduino Uno is still clocked with 16 MHz crystal.

To boost your Arduino Uno's performance up to 25% faster, all you have to do is replace the 16 MHz crystal with 20 MHz crystal, and update the bootloader with one that designed for this upgraded speed (see instruction below).

Please note that this is NOT overclocking, we'll just tuning it to maximum speed allowed by manufacturer as stated in ATmega328 datasheet. So it's 100% safe and guaranteed to run as reliable as before, it's just 25% faster :) up to nearly 20 MIPS!

Step 1: Add following content to your boards.txt (located in hardware/arduino sub-directory of the Arduino application directory, i.e. \Program Files (x86)\Arduino\hardware\arduino in default installation path on 64-bit Windows (or \Program Files\Arduino\hardware\arduino if you're still using the immortal WinXP ;)...

##############################################################

atmega328_20.name=Arduino Uno++ 20MHz

atmega328_20.upload.protocol=stk500
atmega328_20.upload.maximum_size=30720
atmega328_20.upload.speed=57600

atmega328_20.bootloader.low_fuses=0xFF
atmega328_20.bootloader.high_fuses=0xDA
atmega328_20.bootloader.extended_fuses=0x05
atmega328_20.bootloader.path=atmega
atmega328_20.bootloader.file=ATmega328_20MHz.hex
atmega328_20.bootloader.unlock_bits=0x3F
atmega328_20.bootloader.lock_bits=0x0F

atmega328_20.build.mcu=atmega328p
atmega328_20.build.f_cpu=20000000L
atmega328_20.build.core=arduino
Step 2: Create new file with name ATmega328_20MHz.hex under hardware/arduino/bootloaders/atmega sub-directory with following content:
Step 3: desolder the old 16 Mhz crystal from Arduino Uno board. Please note that this action may void your warranty, please proceed on your own risk! If you're unsure with this, perhaps it's better to build a brand new Arduino compatible board by your own from scratch. For example, you can buy Playduino-One kit from Play-Zone — they ship worldwide — for Fr. 19.9 (about USD 21). If you live in Indonesia, you can also purchase Playduino-One Kit from azTech for only Rp150.000,- (less than USD 14).
Step 4: Install a 20 MHz crystal. Soldering should be easy since space on bottom surface is sparse.
Step 5: Burn the bootloader: open Arduino IDE, if you've done step #1 correctly then a new board should be appear under Tools > Board menu with name Arduino Uno++ 20MHz. Select the new board, attach USB cable to Arduino (or ISP programmer if you build Playduino One), and execute Tools > Burn Bootloader command. That's all, now you have a much faster Arduino!

3 comments:

  1. Can I use the bootloader for Arduino mini pro?
    Thank you !
    Vasilis

    ReplyDelete
  2. Can You make a bootloader for Atmega168 25Mhz?

    ReplyDelete
  3. Will this bootloader preserve the accuracy of all timing instructions written in C++ 1.e. "delay (1000);" equals 1 second? I have designed many boards using the ATMEGA 328 but some of my programs are so elaborate they initialize noticeably slow. This is written for one of my boards and initializes slowly.
    https://github.com/captainglen/products/blob/master/U8g_OLED_Geiger.ino

    ReplyDelete