ATtiny Programming with USBasp

ATtiny Programming with USBasp is the easiest alternative to refer to if we have problems programming our microprocessor directly via USB or other development cards such as Arduino UNO in our previous ATtiny articles. With USBasp, you can program other ATmel microprocessors. First of all, let's talk about USBasp:

What is USBasp?

USBasp is a USB in-circuit programmer for Atmel AVR microprocessors. It consists simply of an
ATMega8 and several passive components. In home conditions, this programmer circuit is quite easy to make, but currently USBasp programmers are cheap and hassle-free, using only a USB drive with firmware, no special USB controller required.

ATtiny via USBasp
USBasp Programmer

Installation of Required Libraries

First, we will use the Arduino IDE for the entire programming process. If you have previously done ATtiny operations on the Arduino IDE, the required library is already installed, if the library is not installed, you can download it here, or you can add the following URL to additional card preferences in arduino IDE:

http://drazzy.com/package_drazzy.com_index.json
ATtiny via USBasp
ATtiny via USBasp
ATtiny via USBasp

Tools > Programmer: Note that the option must be USBasp.

ATtiny via USBasp

USBasp Driver Setup

To use the USBasp programmer, it is necessary to first install the required driver.

For Windows Operating System

Download the required drive here, open the compressed file (.zip) and install it by running the InstallDriver.exe file. If the installation and installation were successful, you will see the "USBasp" section in Device Manager.

ATtiny via USBasp

For MacOS Operating System

If you are using a MacOS operating system, there are no USBasp drivers that you need to install, you can start using it directly. To check if USBasp is working:

ATtiny via USBasp

Connection Schema

USBasp ProgrammerATtiny45/85
MOSIMOSI(Pin 5)
MISOMISO(Pin 6)
SCKSCK(Pin 7)
RESETRESET(Pin 1)
VCCVCC(Pin 8)
GndGND(Pin 4)

Setting these pins can be done in several ways, you can use the 6 to 10 pin cable that comes with the programmer, or you can get help directly from the jumpers, the connection path here is entirely up to you.

Program ID

In fact, the program code consists of a simple blink code, as you know, the code that runs on any Arduino development card will work directly on ATtiny microprocessors if the pins are compatible.

void setup() {
  pinMode(1, OUTPUT);
}

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

Printing Boxes to USBasp with a 3D Printer

Many development cards, programmers have pre-prepared boxes. This is what we found in advance for our USBasp programming card. We started printing and using the STL design file with our 3D printer tool, thanks to direct access to the pins, we use this box without problems, we can completely avoid both visual and possible short circuit problems.

Hence You can download the design created for the USBasp programmer for printing. This. You can access the 3D design imaging interface that we created to preview the STL file.

ATtiny via USBasp
Example of Design

Print Result

ATtiny via USBasp
ATtiny via USBasp