Collection of reference, tutorial, cheatsheet, tips and tricks for Arduino and related shields / modules. You can also get code snippets and alternative library for programming Arduino, highly optimized for better performance and smaller code size. Also feature some schematic for your Arduino projects. You can also build your own Arduino DIY from scratch, or hacking / tweaking Arduino boards according to your needs.
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 ;)...
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!
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
Can I use the bootloader for Arduino mini pro?
ReplyDeleteThank you !
Vasilis
Can You make a bootloader for Atmega168 25Mhz?
ReplyDeleteWill 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.
ReplyDeletehttps://github.com/captainglen/products/blob/master/U8g_OLED_Geiger.ino