Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

ATtiny85 microcontroller tutorials, Part 2: Working with ATtiny85

By Ashutosh Bhatt July 27, 2021

Working with ATtiny85 requires you to learn how to write a program for ATtiny85 and how to download it into its internal Flash memory. Would it surprise you to know that we can write programs for ATtiney85 in Arduino IDE? Yes, it is true. We can write, compile, create HEX files and even download the program in ATtiny85 using Arduino IDE.

Sounds interesting! Isn’t it?
So what are we waiting for? Let’s start. Follow the step-by-step process.

Step1: Download Arduino IDE software from https://www.arduino.cc/en/software. Download the ZIP folder to your local hard drive. Unzip it and from the Arduino folder, run Arduino IDE software. You will get the following screen:

Step 2: Get the ATtiny microcontrollers board support in Arduino IDE. There is no support available for ATtiny microcontrollers, so we have to download them.

To download, go to file->preferences. You will get the following screen:

In additional boards manager URLs, please copy and paste the following link:
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

Now go to tools->boards->board manager
In the board manager, type ATtiny and search for boards. You will get Attiny by Devid A Mellis. Click on install. And that’s it. The ATtiny microcontroller board support is now installed in your Arduino IDE.
Now once again, go to tools->boards and scroll down. You will find ATtiny25/45/85.

Select board as ATtiny25/45/85
Processor ATtiny85
Clock internal 1 MHz

Now your Arduino IDE software is ready to compile programs for ATtiny85. We can write all the programs for ATtiny85 just like we write programs for the Arduino board. We can use all Arduino functions like analogWrite(), analogRead(), digitalWrite(), digitalRead(), pinMode() etc all most all to make a program for ATtiny85.

Now the software part to program ATtiny85 is complete. But what about the hardware? How do you download the program into the internal Flash of ATtiny85? That is also simple.

Step 3: Get the USB SPI programmer.
You can use any USB SPI programmer like USBasp or any other because ATtiny85 also supports ICSP like any other AVR microcontroller. We have seen in ATtiny85 pin functions, ATtiny85 has full function SPI with MOSI-MISO-SCK pins using which we can program it. Just get any USB SPI programmer and make the following connections:

As shown in the figure, the respective pins MOSI, MISO, SCK, RESET, Vcc, and Gnd of SPI programmer are connected with ATtiny85 pins: 5(MOSI), 6(MISO), 7(SCK), 1(RESET), 8(Vcc) and 4(Gnd).

Your ATtiny85 is ready to program.

Step 4: Create HEX file for ATtiny85 program in Arduino
You write any program for any project or application for ATtiny85 in Arduino and compile it. Once it is compiled, create a HEX file for the program downloaded into internal Flash.

To create a HEX file in Arduino IDE, just go file->preference and tick the compilation checkbox. Click OK and recompile the program.

This time compilation will take longer, and you can observe the detailed compilation process in the Arduino IDE output window. Finally, you will find created HEX file in the output window, as shown in the figure.
Step 5: download HEX file into internal Flash of ATtiny85
To download the HEX file into ATtiny85, you can use any software (free to download) like ponyprog or progISP that supports USB SPI programmer. I am using progisp software to upload the HEX file into the internal Flash of ATtiny85. Here is the screen of PROGISP software:
In this, from file menu -> load the Flash with the HEX file we have created in Arduino IDE.
Select chip as ATtiny85
Select programming options as 1) chip erase 2) blank check 3) Program Flash 4) verify Flash.
Click auto button.
The program is downloaded into ATtiny85.

In summary, this is how you can write, compile, and create a HEX file for ATtiny85 using Arduino IDE and download the program using any USB SPI hardware and software.

Our next tutorial will walk you through making your first hello world application that is an LED blinking application using ATtiny85.

You may also like:


  • ATtiny85 microcontroller tutorials, Part 5: LED intensity control using ATtiny85

  • ATtiny85 microcontroller tutorials, Part 6: LED intensity control using potentiometer…

  • Tutorial 7: DC motor speed control using ATtiny85

  • ATtiny85 microcontroller tutorials, Part 3: Building LED blinking application using…

  • ATtiny85 microcontroller tutorials, Part 4: LED chaser using ATtiny85
  • ATtiny85
    ATtiny85 microcontroller tutorials, Part 1: Introduction

Filed Under: Featured Contributions
Tagged With: Arduino, ATtiny85, SPI programmer
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: 5G Technology
This Tech Toolbox covers the basics of 5G technology plus a story about how engineers designed and built a prototype DSL router mostly from old cellphone parts. Download this first 5G/wired/wireless communications Tech Toolbox to learn more!

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • Right Half Plane Zero
  • dc-dc converter in series
  • Single ended measuring ports and balanced antenna
  • Thermal modelling of repetitive power pulse
  • Permittivity and Permealibility in CST

RSS Electro-Tech-Online.com Discussions

  • Fun with AI and swordfish basic
  • Microinverters and storeage batteries?
  • FFC connector white
  • Is AI making embedded software developers more productive?
  • Can I make two inputs from one??

Featured – LoRa/LoRaWan Series

  • What is the LoRaWAN network and how does it work?
  • Understanding LoRa architecture: nodes, gateways, and servers
  • Revolutionizing RF: LoRa applications and advantages
  • How to build a LoRa gateway using Raspberry Pi
  • How LoRa enables long-range communication
  • How communication works between two LoRa end-node devices

Recent Articles

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe