Introduction: Programming the 'AtTiny85' With the 'Tiny AVR Programmer' and Supplemented 'Arduino IDE'

Picture of Programming the 'AtTiny85' With the 'Tiny AVR Programmer' and Supplemented 'Arduino IDE'

Using Atmel's little 8 pin AtTiny85 microcontroller as a standalone is a great alternative to the larger 28 pin AtMega328 mounted on an Arduino Uno board. I have switched from one to the other by various means, but what I found easiest was using Sparkfun's Tiny AVR Programmer. Couple that with the AtTiny85 and a supplemental folder dropped into the Arduino IDE, and a no-fuss, versatile, inexpensive programming method is born.

This project was accomplished on a pc with a Windows system; a similar tutorial for Macs (though with less explanation) can be found here:

Link: AtTiny85 with Macs; short tutorial

Step 1: What You Will Need

--A computer/laptop, with knowledge whether it is 32 or 64 bit

--The Sparkfun Tiny AVR Programmer. You can purchase one for under $20 here:

Link: Tiny AVR Programmer

--An Atmel AtTiny85 microcontroller. You can purchase one for under $3 here:

Link: AtTiny85 Microcontroller

--Arduino IDE Software, the AtTiny supplement folder, and the Tiny AVR Programmerdriver, all which can be downloaded for free from the hyperlinks below

Step 2: Installing the Arduino IDE Software on Your Computer/laptop

This application will allow you to write, paste, and/or modify code on your computer, then send it into your AtTiny85 microcontroller via the Tiny AVR Programmer device.

--Download the software here:

Link: Arduino IDE software

--Install software on your computer/laptop.

Step 3: Supplementing the Arduino IDE With the Downloaded AtTiny Folder

The Arduino IDE application does not contain the necessary files to work with AtTiny microcontrollers, but it neither rejects them, and that is a good thing! The files can be downloaded and added.

--Download the ATtiny master.zip file here:

Link: AtTiny supplement folder for the Arduino IDE

--Unzip the file, and navigate from the ‘ATtiny-master’ folder to the desired ‘Attiny’ folder. You will need this second folder in a moment.

--Navigate to your computer/laptop “Local Disk (C:) > Program Files (x86) > Arduino > hardware”. (If there is no existing “hardware” folder, create a new one.) Copy and paste (or drag) the ‘ATtiny’ folder into the ‘hardware’ folder.

--Restart the Arduino IDE. There should now be ATtiny entries in the “Tools > Board menu”.

Step 4: Ready the Tiny AVR Programmer (the Most Difficult Step)

Plugging in the Tiny AVR Programmer should be a no-brainer, but it requires a manual installation of its driver, and possibly the selection of a serial port.

--Within the Arduino IDE, navigate to "Tools>Serial Port" and simply note what you see. It might be no more than the one default "COM1."

--Plug the Tiny AVR Programmer in the computer/laptop USB port.

--Navigate again to the "Tools>Serial Port" and observe whether another COM port has appeared. If so, that is the one. Select it. If not, check once more after the driver has been installed, and select the new COM port if it appears.

--Download the Tiny AVR Programmer driver (must specify either 32 or 64 bit computer/laptop) here:

Link: Driver for the Tiny AVR Programmer

--Install the driver. Additional instructions (as well as another link for the driver) can be found here:

Link: Instructions for the AVR Programmer driver

--Within the Arduino IDE menu bar, navigate to "Tools>Programmer>USBTinyISP", and select it.

Step 5: Tell the Arduino IDE It's Working With an AtTiny85

--Insert the AtTiny85 microcontroller into the Tiny AVR Programmer socket.

--In the Arduino IDE’s menu bar, navigate to "Tools > Boards > ATtiny85 (ext 1MHz clock)", and select it. Though the chip itself is 20MHz, it is set to 1MHz for this project.

Step 6: Program Your AtTiny85 With Simple "Blink" Code

--In the Arduino IDE Menu Bar, navigate to "File > Examples > 01.Basics > Blink”, and select it.

-- Within the code, change “int led 13” (Arduino Uno/AtMega328 ic pin/lead 19) to “int led 0” (Sparkfun AVR Programmer/AtTiny85 ic pin/lead 5): these are the pins whose boards both have a test led attached.

--In the Menu Bar, select “File > Upload” to dump the code into the AtTiny85 microcontroller.

--The test led on the Tiny AVR Programmer should start blinking. It is the goal of the "Blink" code.

From here the Attiny85 microcontroller may be removed and used on a breadboard or in a project.

COMING UP: THE ATTINY85 MICROCONTROLLER ON A BREADBOARD, AND PLAYING WITH THE CODE.

~frpmabq

Comments

JRV31 (author)2015-04-16

Very good Instructable. I like this programmer.

If you want to run the chip at 8 MHz, after you select the programmer in the Arduino IDE select the "ATtiny85 (internal 8 MHz clock)" options on the Boards menu. Then select "Burn Bootloader" from the Tools menu. This does not actually burn a bootloader, it just sets the fuse bits to clock it at 8 MHz. From this point on you must select the 8 MHz option when programming the ATTiny.

The instructions provided by Sparkfun do not make this clear.

zonkerharris (author)JRV312017-01-16

Great tips, and they are a good addition to the info in this instructable. I love the little red Tiny programmer, too!

zonkerharris (author)2017-01-16

Thank you for the instructable. You covered some of the tricky bits (like adding the USB driver for the SprakFun USB programmer. Like JRV31 below, I really like this programmer as well.

JRV31 also makes a couple very good points about using the "Burn Bootloader" command, if you want to change any of the core settings on the tiny, such as increasing the clock speed (which you must do, if you want to use NeoPixels with an ATtiny85). These were the steepest part of making a Tiny work with my neopixel projects. I wrote up one of them as an instructable, since it was so hard to find those clues in other folks write-ups. I also add many clues in comments in the sketch code, since comments do not count against on-chip memory of your sketch. If your curious, you can find my project at https://www.instructables.com/id/IKEA-Star-With-ATtiny-and-NeoPixels/

MsSweetSatisfaction (author)2015-01-05

Awesome gadget! Thanks for sharing your knowledge, and welcome to instructables!

Thank you!

About This Instructable

11,422views

76favorites

License:

More by attiny85etc:Programming the 'AtTiny85' with the 'Tiny AVR Programmer' and supplemented 'Arduino IDE'
Add instructable to: