There are a number of posts on the subject already, but I’d like to share my experience as well. Here are the steps I undertook to set up my environment for working with Attiny84 and Attiny85:
- As a first step, of course get the latest Arduino IDE. You can keep your old environment intact by installing it in a new folder – I do that myself so I can work with old libraries that are not ported to IDE 1.0 or newer. You get the latest IDE from the official web site.
- I am running a 64bit Windows 7 laptop and freshly installed Arduino IDE is terribly slow to open the menus. This is due some bug that has been carried over for ever since at least IDE #17, but fortunately there is a fix. Read all about it here, the fix is to replace a faulty DLL that gives you trouble on 64bit Windows systems.
- Next, get the latest Arduino Tiny Core from here. The included in the archive Readme gives you all you need to know on installing the core:
* Ensure the Arduino IDE is NOT running. * Download the Arduino-Tiny archive (ZIP-file). * Locate the Arduino Sketch folder. This is the folder where the Arduino IDE stores Sketches. * Ensure the "hardware" folder exists under the Arduino Sketch folder. For example, if the Arduino Sketch folder is... C:\Projects\Arduino\ Ensure this folder exists... C:\Projects\Arduino\hardware\ * Extract the contents of the archive into the "hardware" folder. For example, if the Arduino Sketch folder is... C:\Projects\Arduino After extracting, the following two files should exist... C:\Projects\Arduino\hardware\tiny\boards.txt C:\Projects\Arduino\hardware\tiny\bootloaders\attiny84\empty.hex And the following folder should contain the Arduino-Tiny core... C:\Projects\Arduino\hardware\tiny\cores\tiny\ * Open the "boards.txt" file and change both of the "upload.using" entries to the appropriate value for your setup. Following from the examples above, the file would be here... C:\Projects\Arduino\hardware\tiny\boards.txt * Start the Arduino IDE and ensure there are two new boards listed under the [Tools] [Board] menu... "ATtiny84 @ 8 MHz" "ATtiny84 @ 1 MHz" You are now ready to use Arduino-Tiny!
4. I have found that many of the compiler errors that you will stumble upon, if you leave it here are related to not updating the avr toolchain. Most probably you will be seeing error messages relating to R_AVR_13_PCREL. There is a good explanation on how to update the avr toolchain that comes bundled with the Arduino IDE to the latest version here.
5. We are almost there 🙂 . There is some nasty incompatibility between the Jeelib that we heavily rely on and the Tiny Core, luckily there is a solution as well. Follow the instructions here if you get errors like “hardware\tiny\cores\tiny/Print.h:71: error: overriding ‘virtual void Print::write(uint8_t)'” . The fix requires editing a bit the Ports.h and Ports.cpp so that they work and don’t give you trouble.
So with these steps you do have a fully operational Arduino IDE that supports Attinys.
I program the little guys with an USBTiny ISP programmer, just be careful when you program them and have 3.3V components on the board as well, such as the RFM12B module. Most ISP programmers (like the USBTiny ) do have a jumper that when removed does not power the board with 5V, thus you can use a battery or other 3.3V power source and not fry the other components. If you don’t own an ISP programmer, I do recommend you get one. They are quite cheap and available on ebay for example. I work with USBTinyISP v3.0.
Alternatively you can program the ATTinys with an Arduino as a programmer, but that is rather masochistic approach given that an ISP programmer costs $9 delivered.