Programming ATtiny Micro Controllers With Arduino UNO.

by arduinomaster in Circuits > Arduino

14589 Views, 100 Favorites, 0 Comments

Programming ATtiny Micro Controllers With Arduino UNO.

tiny_fritzing.PNG
DSCN5227.JPG

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

Many Different Types Can Be Programmed

DSCN5221.JPG
additional.png

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.

Next, Open the Board Manager

boards.png
DSCN5201.JPG
DSCN5208.JPG
DSCN5209.JPG

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.

Connecting Your Tiny to the UNO

tiny_fritzing.PNG
DSCN5227.JPG
DSCN5233.JPG

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!

Open the Blink Sketch for Testing

DSCN5210.JPG

Change the pin numbers you want to use.

You have 0 to 4 available.

or use this sketch

Downloads

Board and Bootloader

DSCN5204.JPG
DSCN5213_d800.JPG

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.

Upload to Tiny by Holding Down the Shift Key

idle_d800.jpg
DSCN5211.JPG
Attiny85-copy_600.jpg

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.

Optional Wires

optional.PNG
mega.PNG

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.

Comments Answered in Detail:

DSCN5236.JPG
DSCN5247.JPG
programmer.PNG
DSCN5248.JPG
DSCN5249.JPG

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.

Where to Buy

Where to buy:

email to

arduinomastercomau@gmail.com