Setting up the software for using Arduino as the In System Programmer (ISP) to download program onto ATtiny85
Step0: Install ATTiny Cores
NOTE: This Tutorial assumes Arduino v1.0.x and above has been installed on the computer.
Go to this URL https://github.com/damellis/ATtiny/archive/master.zip and download this file: master.zip
Extract this file and copy the entire folder to the “hardware” folder of your Arduino installation directory. Note: The following screen is mine and might differ from yours.
Restart the Arduino IDE programming environment.
Verify the new cores (ATtinyXX series) loaded in Arduino IDE.
Note that there are also other core files for a variety of ATtiny chips loaded e.g ATting85. This page is a good starting point for interfacing with a wide range of the ATtiny or ATtiny85 using the Arduino.
Click on Tools , Board to verify the variety of ATtiny chips.
Programming the ATtinyXX chip with Arduino as the ISP
Note: This is a 1 + N step. Step 1 requires setting up the Arduino as the ISP for the first time progamming of an ATtiny. Step N has to be repeated every time to program an ATtiny. The ATtiny chip has to be placed on the ATtinyXX ISP shield, and then connected to the Arduino. The program will then be downloaded to ATtiny instead of Arduino.
Step1: Setting up Arduino as the ISP
- Connect usb cable to Arduino
- Go to Tools->Board and make sure Arduino Uno is selected.
- Make sure that the correct serial port is selected.
- Go to Tools->Programmer -> Arduino as ISP
- Go to Examples -> ArduinoISP
- Click to upload the ISP program to the Arduino
- Now your arduino is ready to be used to program it's poor cousin, the ATtiny85.
Step N part1: ATtinyXX chip is inserted into ATtinyXX ISP shield; shield is then connected to the Arduino.
- Confirm USB cable is unplugged from Arduino when inserting the ISP shield
- Align ATtiny85 DIP8 package chip to ATtiny85 ISP shield
- Insert ATtiny85 chip firmly onto the ISP shield
- Align ISP shield to Arduino
- Insert ISP shield firmly onto Arduino
Question: What is the model of the ATtiny chip in the picture above?
Note: ATtiny45/85-PU is 20MHz (with external clock). refer to the datasheet at References.
Click here for highres picture https://www.dropbox.com/sc/bo8yblnevzrf1vu/KrTsbTAOBU
Click here for highres picture https://www.dropbox.com/sc/bo8yblnevzrf1vu/KrTsbTAOBU
Step N part 2: Download your programming code to ATtiny85
- Confirm chip, shield, and Arduino is plugged into USB.
- Select the corresponding code of choice (e.g *.ino) file to be programmed onto the ATtiny85 chip by clicking File-> Open.
- Go to Tools -> Board and make sure this time you choose ATtiny85(internal 1 MHz clock)
- Click to upload the program.
- Upon success, you should see the message below. Ignore the warnings. The ATtiny chip has been programmed.
- Observe the output of the operational ATtiny85 programmed with the code specified.
NOTE: by default ATtiny85 comes with 1MHz clock internal. This clock can be modified to 8MHz internal by the selecting option "Burn Bootloader" while selecting the option "ATtiny85(internal 8MHz clock)". Subsequent programming of ATtiny85 need to choose the board option "ATtiny85(internal 8MHz clock)"
References
ATMEL ATtiny85 data sheet http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf
Addendum: Old version of Arduino, e.g Arduino 0022
New ATtiny cores eg ATtiny85 on Arduino 0022
Select ATtiny45-20PU as the board (requires external oscilator to function at 20MHz)
Download RGB LED code to ATtiny45
No comments:
Post a Comment