Programming The Attiny45 With An Arduino As ISP Programmer

Attiny Arduino programming shiled
Share:

About

In this post, I’ll show you how to program the Attiny microcontrollers via the Arduino IDE using an Arduino board as an ISP programmer.

Hardware used:

Hardware Connections

You can make these connections on a breadboard or you can make a shield for the Arduino like I did. A shield will make it much easier the next time as you don’t have to redo all the wiring again. You simply plug in the shield and you are ready to go. I also added a ZIF(zero insertion force) socket to make it easier to insert/remove the attiny chip.

Convert The Arduino Into An ISP Programmer

In the Arduino IDE go under Examples -> 11.Arduino ISP and select the Arduino ISP sketch. Upload this to your Arduino and it will now act as an ISP programmer.

Adding Attiny To The Arduino IDE

In the Arduino IDE go under File -> Preferences.
When the Preferences window opens up paste this URL https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json into the input box.
Note: If you have a URL from another board added put the ESP32 URL after that one and separate them with a comma like so: your first url,your second url
Open the Boards Manager under Tools -> Board -> Boards Manager… Then type esp32 and install the esp32 boards.
Select your board like so Tools -> Board -> ATtiny Microcontrollers -> “The MCU you are using” and then set the rest of the settings like in the image below(you can speed up the clock if you want):
Note: It’s important you select “Arduino as ISP” for the programmer.

Firmware

This is just a simple blink program we’ll use to verify that we are able to program the Attiny MCU.
void setup()
{
  pinMode(1, OUTPUT);  
}

void loop()
{
    digitalWrite(1, HIGH);
    delay(500);
    digitalWrite(1, LOW);
    delay(500);
}

Flashing And Testing

Upload the firmware, put the Attiny into the circuit and if everything went right the LED should be blinking.
Share:

Leave a Reply

Your email address will not be published. Required fields are marked *

The following GDPR rules must be read and accepted:
This form collects your name, email and content so that we can keep track of the comments placed on the website. For more info check our privacy policy where you will get more info on where, how and why we store your data.

Advertisment ad adsense adlogger