Introduction: Programming ATtiny Micro Controllers With Arduino UNO.

Picture of Programming ATtiny Micro Controllers With Arduino UNO.

How to program ATtiny's with Arduino UNO:

In Arduino 1.6.5 or above, you can install the ATtiny support using the built-in board's manager. Open the preferences dialog in the Arduino software.Find the “Additional Boards Manager URLs” field near the bottom of the dialog.

Works best with the Arduino 1.6.5 IDE or above. As programming can accommodate different types:

I just tried Arduino 1.8.1 and it works fine.

I am planning to make a video, but for now look at this one as it contains a little programming with this programmer. Cut and paste this link into your browser.

https://vimeo.com/204130614

Step 1: Many Different Types Can Be Programmed

Picture of Many Different Types Can Be Programmed

Open the preferences dialog in the Arduino software.

Find the “Additional Boards Manager URLs” field near the bottom of the dialog.

Paste the below URL into the "Additional Boards Manager URLs:" field (use a comma to separate it from any URLs you’ve already added):

**********************************************************************

https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

***********************************************************************

Click the OK button to save your updated preferences.

Step 2: Next, Open the Board Manager

Picture of Next, Open the Board Manager

Open the board's manager in the “Tools > Board” menu.

Press the install button to install the driver.

Go to Boards Manager and choose the Arduino UNO board.

Connect your Arduino UNO.

Then open the ArduinoISP sketch in samples.

Upload the unchanged ArduinISP sketch to your Arduino UNO.

Step 3: Connecting Your Tiny to the UNO

Picture of Connecting Your Tiny to the UNO

Connect wires from the Arduino to the ATtiny 85 chip to a breadboard as seen in the picture.

Or use my programmer. Simply clip it onto the Arduino Board and insert a chip or another surface mount board as shown in my pictures.

For safe purchases via PayPal email me.

$AUS 12.50 or make payment to the below email address.

arduinomastercomau@gmail.com

FREE POSTAGE within Australia
International $5

Or check out my last Instructable "Where to buy" page if they are on eBay!

Step 4: Open the Blink Sketch for Testing

Picture of Open the Blink Sketch for Testing

Change the pin numbers you want to use.

You have 0 to 4 available.

or use this sketch

Step 5: Board and Bootloader

Picture of Board and Bootloader

Change the

  • Board to ATtiny 25/45/85
  • Processor:"ATtiny85"
  • Clock:Internal 8MHz"
  • Port leave as is connected to the Arduino UNO
  • Programmer: Arduino as ISP

Make sure you choose the 8MHz (internal oscillator) as there is no external oscillator connected.

  • Burn Bootloader if it is a new ATtiny 85.

Yes click the burn Bootloader to change the new chip from 1 MHz to 8 MHz.

Step 6: Upload to Tiny by Holding Down the Shift Key

Picture of Upload to Tiny by Holding Down the Shift Key

Did you make changes to the Blink sketch?

The Tiny has only 5 usable pins. The Pin 1 is not used as it is the reset pin.

Do not confuse the pins on the chip 1 to 8 with the programming PB numbers.

  • Tiny Pin 1 is Reset.
  • Tiny Pin 2 is PB3, // In your IDE software you address pin 3
  • Tiny Pin 3 is PB4, // In your IDE software you address pin 4
  • Tiny Pin 4 is GND or ground or minus
  • Tiny Pin 5 is PB0, // In your IDE software you address pin 0
  • Tiny Pin 6 is PB1, // In your IDE software you address pin 1
  • Tiny Pin 7 is PB2, // In your IDE software you address pin 2
  • Tiny Pin 8 is Vcc o 5volt + input

Hold down the Shift key. Then you see a change in the top display when idling over the upload button.

Hold the Shift key (on PC) and click "upload to programmer" to upload the sketch. Then release the shift key.

Wait a few seconds for the sketch to upload.

Step 7: Optional Wires

Picture of Optional Wires

I added photos for you if LED's to test the board directly are required.

And if things still don't work?

  • Replace the programming cable to the Arduino. Some are only for charging.
  • Do not use the authentic Arduino Leonardo Board as it does not work.

If you only have an Arduino Mega Board. the wiring is different as shown in the ArduinoISP sketch

What commands are supported:

The following Arduino commands should be supported:

  • pinMode()
  • digitalWrite()
  • digitalRead()
  • analogRead()
  • analogWrite()
  • shiftOut()
  • pulseIn()
  • millis()
  • micros()
  • delay()
  • delayMicroseconds()
  • SoftwareSerial (has been updated in Arduino 1.0)

Supported Libraries

  • ArduinoTinyWireM
  • TinyWireS
  • Wire (I2C / TWI)
  • library for the ATtiny85 (using USI)Servo8Bit
  • Servo library for the ATtiny45/85.

Step 8: Comments Answered in Detail:

Picture of Comments Answered in Detail:

A USBASP programmer allows you to program Tiny and also install new bootloaders and firmware on common AVR microcontrollers, such as those used in Arduino-compatible boards.

Instructions can be found here.

http://www.freetronics.com.au/pages/usbasp-icsp-programmer-quickstart-guide#.WJuX1jt95hE

This programmer is also described in Silicon Chip January 2017 edition to program an ATiny.

There they describe how to make your own cable.

A better way is to purchase a programmer for just over a dollar on eBay that works fine. Only do not solder all supplied 8 pins to the board. Only solder 3 rows at the top as shown in the picture.

Then you can connect the USBASP programmer to this programmer board. As those are sold as programmers but I never got them working as a programmer via USB.

(What inspired me to write this "the simple way" Instructables on "how to".

A complicated more expensive unnecessary way for the Tiny.

But very useful for new boot loading ATmega AVR chips.

Note that ones you program in this way you have to do it all the time.

The USB method will no longer work until you burn the bootloader again. And then without uploading a sketch change from the programmer to USB and upload a sketch the normal way with your PC.

I hope this is helpful to you.

Step 9: Where to Buy

Where to buy:

I have a current listing on eBay for the programmer.

http://cgi.ebay.com.au/ws/eBayISAPI.dll?ViewItem&item=201793932921#ht_500wt_1212

Comments

RaduL5 (author)2017-04-03

Nice tutorial but can you explain how to power, externally an Attiny avr ?

Thank you.

Tecwyn Twmffat (author)2017-02-05

Nice explanation thanks. I need to boot up an ATmega2560 sometime soon.

You would need a USBASP programmer for boot loading the Atmega. But do not add a sketch afterward. Program your sketch normally via USB.

About This Instructable

4,854views

78favorites

License:

Bio: The key to success is to be giving exceptional experience to anyone becoming a fan of your club over a long period of time. There ... More »
More by arduinomaster:Programming ATtiny Micro Controllers With Arduino UNO.Free sounds for your robot, podcast or film productionNikon IR remote and time laps with ATtiny 85
Add instructable to: