Sunday, 09 December 2012 15:27

Changing the Tiny Arduino clock between 1MHz and 8MHz

Written by
This article shows how to make a simplest & cheapest Arduino. The clock speed is running at 1MHz even though you select 8MHz internal clock. This is because the Div8 fuses bit of the new ATtiny85 is enabled by default, therefore 8MHz divided by 8 is 1MHz. In order to resolve this problem, we nee to disable the Div8 fuse bit using a AVR programmer.
 
Here I provide a method to switch the Tiny Arduino clock speed between 1MHz and 8Mhz by using a Arduino Duemilanove as an ISP programmer.
 
 
Prerequisite
  • An Arduino  Duemilanove which is is running on an Windows computer
  • ATTiny44, ATTiny45 or ATTiny85. Here I use ATTiny85 as the example.
  • Make sure the ATtiny is communicate with Arduino ISP based on this article.
 
Download & install Attiny plugin
  • Download the AtTiny plugin
  • Extract it to the Hardware folder of your Arduino sketchbook location. Make a new hardware folder if you don't have one . You can find your sketchbook location under File>Preferences of Arduino menu
  • Now you have attiny folder (attiny-master is removed) inside the Hardware folder as shown in figure below. This will create a ATtiny85 (internal 8MHz clock) item under Tools>Board of Arduino menu
Arduino ATtiny
 
 
 
Program the ATtin85
  1. Run the Arduino software, it must be Version 1.0 and above. The software is available here.
  2. Select Tools>Board>ATtiny85 (internal 8MHz clock) from menu as shown in figure below.

Arduono ATtiny Enviroment 8Mhz

  • Select Tools>Programmer>Arduino as ISP from menu
  • Select Tools>Burn Bootloader from menu to start writing bootloader to ATtiny85. The ATtiny85 does not have bootloader, it just write the fuse bit to the ATtiny85)
  • You will get two lines of error message as below. It is OK just ignore this message.
 

avrdude: please define PPAGEL and BS2 signals in the configuration file for part ATtiny85

avrdude: please define PPAGEL and BS2 signals in the configuration file for part ATtiny85

The Tiny Arduino should running at 8MHz faster speed, but the exising sketch inside the Tiny Arduino will not working anymore, you have to upload the sketch again with the new clock speed.
 
Note:
To recover to the previous 1MHz clock speed is pretty easy, just follow step 2 and change it to ATtiny85 (internal 1MHz clock), the rest of steps is exactly same.
 

http://ediy.com.my/index.php/blog/item/48-simplest-and-cheapest-arduino

Read 35404 times Last modified on Sunday, 12 June 2016 11:09
Back to Top