Arduino IDE – Setup Guide (ARCHIVE)

UPDATE: There is an updated version of the Arduino Setup Guide at our new website https://tinusaur.com/guides/arduino-ide-tinusaur-setup/

An updated version of the guide is available at Arduino IDE Setup page. There is also the Arduino page where we will post more information about working with the Arduino IDE. Below is the older version of the guide.

This is a short guide how to setup and use Arduino IDE for programming the Tinusaur Board  and the ATtiny85 microcontrollers in general as well as some sample programs and some useful tips.

Arduino Project

Note: This guide was tested under Microsoft Windows 8.1 operating system.

Note: The example source code was tested on ATtiny85 microcontroller installed on a Tinusaur Board and programmed using USBasp ISP programmer.

Note: This is not a guide how to use the Arduino IDE but rather how to setup one for use with AТtiny microcontrollers and specifically the Tinusaur.

Installation

The Arduino IDE is available for download at http://arduino.cc/en/main/software and the actual files are located at https://code.google.com/p/arduino/downloads/list.

Arduino IDE

The file name should be something like this: arduino-X.X.X-windows.exe

Part of the installation will be to install the “Arduino USB Driver”, so the operating system may ask (for security reasons) you if it should do so, choose “Install”.

The installation creates a short-cut icon on the desktop.

Start the Arduino IDE to make sure it is installed properly.

The Arduino IDE comes with support for the most commonly used Atmel microcontrollers (ATtiny, ATmega, etc.) and boards (Arduino Uno, Arduino Nano, etc.) and the Tinusaur broads is not among them so additional tuning up is required.

Setup the IDE for Tinusaur

There are 2 things that should be done: (1) add the ATtiny boards and the Tinusaur; and (2) setup the USBasp programmer.

Adding the ATtiny Microcontrollers

After the installation of the Arduino IDE in the “Documents” folder there should be a new “Arduino” subfolder. This is where all the Arduino sketches, libraries, definitions and other stuff resides.

The ATtiny microcontrollers are not part of the Arduino IDE by default so they should be added manually.

First, download the https://github.com/damellis/attiny/archive/master.zip file. These are some definitions as well as some C/C++ header files.

In order to add new boards to the IDE do the following:

  • In the “Documents/Arduino” folder create а “hardware” subfolder. It may exist already.
  • Extract the downloaded “master.zip” file somewhere else. Verify that there is a “attiny” subfolder there.
  • Copy the “attiny” subfolder (along with its content – folders and files) into the “hardware” folder. You should have now a “Documents\Arduino\hardware\attiny\” folder.
  • Restart (this may be necessary) the Arduino IDE.

Verify the setup by going to the “Tools/Board” menu and see that there is a list of various ATtiny microcontrollers.

Ref: http://playground.arduino.cc/Main/CustomizeArduinoIDE

Ref: http://playground.arduino.cc/Main/ArduinoOnOtherAtmelChips

Ref: http://highlowtech.org/?p=1695

Adding the Tinusaur Board

This is not required but it is convenient to have a separate entry for the Tinusaur board on the list of microcontrollers and boards.

In order to add the Tinusaur boards to the IDE do the following:

  • In the “Documents/Arduino/hardware/attiny” folder there is “boards.txt” file. Open tha tfile and add the following text at the end:
attiny85.name=Tinusaur/ATtiny85 (int/1MHz)
attiny85.bootloader.low_fuses=0x62
attiny85.bootloader.high_fuses=0xdf
attiny85.bootloader.extended_fuses=0xff
attiny85.upload.maximum_size=8192
attiny85.build.mcu=attiny85
attiny85.build.f_cpu=1000000L
attiny85.build.core=arduino:arduino
attiny85.build.variant=tiny8
  • Save and close the file.
  • Restart (it may be necessary) the Arduino IDE.

Verify the setup by going to the “Tools/Board” menu to see that the “Tinusaur/ATtiny85” board is there.

Arduino IDE Boards

Setup USBasp Programmer

The Windows drivers are available at http://www.fischl.de/usbasp/.

USBasp Programmer

Note: It is not the subject of this guide how to install USBasp drivers – there many resources available on that topic and “WinAVR Setup Guide” is a good start.

The USBasp programmer should be available in the list at the “Tools/Programmer” menu.

Test the Arduino IDE with the Tinusaur

In order to test the setup we should write a program and upload it to a microcontroller.

Write a Testing Program

Follow these steps:

  • Start the Arduino IDE, if it’s not already started.
  • Select from the “Tools/Board” menu the “Tinusaur/ATtiny85” board.
  • From the “Tools/Programmer” menu choose the “USBasp” programmer.
  • Enter the absolute minimal program for Arduino is like this (it does not do anything):
void setup() {
}
void loop() {
}
  • Tinusaur Tutorial 001 schematicsUpload the program by pressing the “Upload” button, or from the menu “File / Upload” or using the shortcut “Ctrl-U”. This will automatically compile the C/C++ code prior uploading.

This process should finish without any errors. The program is not expected to do anything.

Note: In some cases you may get warning messages like this: “avrdude: warning: cannot set sck period. please check for usbasp firmware update.” but that’s fine, at least for now.

Ref: http://arduino.cc/en/Tutorial/BareMinimum

Write a Blinking LED Program

Note: The board should have a LED connected to PB0 with a 330 ohm resistor in series.

This is a program that makes a LED to blink.

int led = PB0;
void setup() {
	pinMode(led, OUTPUT);    // Set the LED port as output
}
void loop() {
	digitalWrite(led, HIGH); // turn the LED on
	delay(200);              // wait for a while
	digitalWrite(led, LOW);  // turn the LED off
	delay(200);              // wait for a while
}

Ref: http://arduino.cc/en/Tutorial/Blink

Arduino IDE Sketch

Upload the program to the microcontroller.

The program should start running immediately after the uploading is finished and the LED should start rapidly blinking.

Other programs that could be written for the Tinusaur (and ATtiny85 in general) using the Arduino IDE but with some limitations. There are many solution to overcome some of those limitation but this is outside of the scope of this document.

More References

Examples: http://arduino.cc/en/Tutorial/HomePage

3 thoughts on “Arduino IDE – Setup Guide (ARCHIVE)”

  1. the folder structure should be: Documents > Arduino > hardware > attiny > avr

  2. For Arduino 1.6.0 I had to add this lines in broards.txt at the end:

    attiny85.upload.tool=arduino:avrdude
    attiny85.bootloader.tool=arduino:avrdude

Comments are closed.