ATTiny85 is a powerful MCU, which offer DIP8 or even smaller package. To program it we need some kind of ISP programmer. Maybe Arduino as ISP is the easiest way if you happened to have one arduino board in your hand. And this Instructable will show you how to make a small ISP programmer in one mini breadboard with a Sparkfun Pro Micro or its clone.
Step 1: Why Pro Micro
The blue board Pro Micro which I used is a Sparkfun Pro Micro clone, definitely has the same pinout as the original one.
- Slightly cheaper (around $3.5 each) than Arduino UNO R3 copies with ATMega16U2 on aliexpress.
- Fit into a small size breadboard (5 pins * 17 rows * 2 sides).
- Still enough space for a DIP8 IC like ATTiny85.
- USB support, no need for an additional USB2Serial converter.
Step 2: Edit ArduinoISP Sketch
The original ArduinoISP sketch use UNO's SS pin (pin10) as reset trigger. However Pro Micro doesn't use SS thus the sketch should be edited a bit.
Open your Arduino IDE (mine is 1.8.4 currently)
File --> Examples --> ArduinoISP --> ArduinoISP
I'll explain why I use pin 2 instead of other pins later.
Then download it into Pro Micro.
Step 3: Add Pro Micro As ISP to Programmers List
While the other Arduino boards like UNO works well in STK500 mode as ISP, the Pro Micro doesn't.
It should work in arduino mode as ISP.
There are two ways to solve the problem. Which are simply add ATTiny85 cores comes with arduino mode support for Arduino as ISP programmer, or edit config file and add it yourself.
Pick the first one because it's easy and stable if you don't know how to add a programmer manually.
- File --> Preferences --> Settings
- Click the window button at the end of "Additional Boards Manager URLs".
- Add "http://drazzy.com/package_drazzy.com_index.json" in new line and click OK and OK to save.
- Tools --> Board --> Boards Manager
- In the "Filter your search..." bar, input "attiny" and press Enter key.
- Choose "ATTiny core by Spence Konde" to install.
- Done and done.
Now you can use "Arduino as ISP (ATTiny core)" when using Pro Micro as programmer.
Step 4: Attiny85 Pinout and ISP Mode
Actually ISP uses SPI + RESET pins. Connect the SPI pins of Arduino as ISP to the same SPI pins on ATTiny85, and RESET pin (which is 2 here) to PB5. Of course VCC and GND as well.
reset PB5 |1 8| VCC PB3 |2 7| PB2 SCK PB4 |3 6| PB1 MISO GND |4 8| PB0 MOSI
Step 5: Wiring
As you can see in the picture, VCC and SPI (SCK, MOSI, MISO) on the same side, beside with one side of pins of Pro Micro.
ATTiny85 has a definition of reset pin on the other side of SPI. So it's better to use a spare pin on the other side of SPI pins otherwise wiring will be complex. Using either pin 2 or pin 3 which did not pre-configed inside ArduinoISP sketch for better compatibility. Notice that the orange wire is UNDER the Pro Micro board, I'm just showing how I wired.
There is an additional LED and 220ohm resistor connect to PB4 and GND of ATTiny85, which can be used to test whether ATTiny85 works.
Step 6: Finishing Board
This is how my Pro Micro ISP looks like.
Plug ATTiny85 or other ATTiny DIP8 ICs into the right side of breadboard, with 1 pin blanked between the Pro Micro.
RESET and GND at the LED side!!!
Burn the bootloader first. Then the blink sketch for test.
Notice that LED_BUILTIN should be defined before setup() function.
#define LED_BUILTIN 4
This Pro Micro ISP can be used as normal ISP for other ATMega or Arduino board as well. Just SPI to SPI, pin 2 to RESET, VCC and GND as well.
This is my first Instructable and I'm not very good at typing in English, if I didn't make myself clear just comment. Thank you.
Have fun then!