Skip to content Skip to sidebar Skip to footer

How to Burn Bootloader and Attiny13 using Arduino

Burn Bootloader and Attiny13 Program with Arduino

How to Burn Bootloader and Attiny13 Program with Arduino - If you want to find a microcontroller with simple use, microcontroller attiny is a choice. One is attiny13.

With features that are not much different from Attiny85, at a cheaper price than Attiny13 can store a program of 1kb. With the size of a memory flash the size of 1kb is enough if you make a simple program.

If you want to use attiny85, you can read the article How to Burn Bootloader and Attiny85 Program Using Arduino ISP.

The use of this Attiny13 microcontroller varies, such as turning on the lights with a motion sensor, turning on the lights with remote infrared, opening the door with a password, making a flash lights and others.

Attiny13 has the following specifications:
  • 8-bit microcontroller
  • External frequency up to 20 MHz
  • Internal frequency up to 9.6 MHz
  • 1kb flash memory
  • 64 bytes EEPROM.
  • 64 bytes Sram.
  • 10-bit ADC 4-Channel
  • 8-pin with 6-pin I / O
  • Operating voltage starts 1.8V - 5.5V
Pinout attiny13 is as follows:

Pin Out ATtiny13

How to Program ATtiny13 Using Arduino

To program this attiny13, we use a Arduino Uno, Nano, Micro and others that support ARDUINO AS ISP. The SPI pin used is:
  • PB2 (SCK)
  • PB1 (MISO)
  • PB0 (MOSI)
  • PB5 (reset). 

1. Install Library

To be able to install the library there are two ways, through the Board Manager at Arduino IDE and install the Manual in the Arduino folder. The thing that must be noticed is, this library only supports Arduino IDE 1.6.4 or above.

a. Install using Board Manager

Open Arduino IDE software
- Open File> Preferences
- At the Additional Boards Manager Urls, enter the link below then click OK:

https://mcudude.github.io/MicroCore/package_MCUdude_MicroCore_index.json


- Open Menu Tools> Board> Boards Manager
- Please wait for the downloaded file.
- Look at the search with the name MicroCore, then click Install.
- After the board is installed, friends will see the list of the board as in this picture.


- Instalasi successful.

b. Manual Install 

- First download this library, Download Library ATtiny13.
- Then extract the ZIP file. - Move the extract folder to the folder / Documents / Aduino / hardware.

- If the "hardware" folder doesn't exist, please make it first.
- Open Arduino IDE, Select Tools> Board (see two images above).
- Installation is complete.

2. Wiring

Please friends follow the circuit below with PIN configuration:


3. Program ATTiny13

3.1 Make Arduino as an ISP

- Open Arduino IDE
- Select the File menu> Examples> 11. ArduinoISP> Arduino ISP
- Select Menu Tools> Board> Arduino / Genuine Uno
- Select the programmer menu> avrisp mkll
- Then click Upload
- Finish

3.2 Burn a Bootloader

Burn a bootloader program is quite important and only just once at the beginning.

It is necessary to make attiny13 will be defined all internal settings of attiny13 such as the size of the frequency value used.

If Attiny13 is not done by bootloader, the performance is not appropriate. For example, we set the Attiny13 program delay turning and turning off the lights is for 1 second. If there is no bootloader, the program can run with 1.5 or 2 seconds delay.

This will have an impact on all attiny13 performance.

- Select Menu Tools> Board> ATTINY13
- Select Menu Tools> Programmer> Arduino as ISP
- Select the Tools> Burn Bootloader menu
- Finish

3.3 Upload Main Program 

- Select the File menu> Examples> 01.basics> Blink
- Replace the word LED_Builtin, follow this program:


led = 3;

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

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

- Connect a LED to PB3 PIN.
- If it blinks for 1 second, the program we have succeeded.

Download Datasheet ATtiny13


2 comments for "How to Burn Bootloader and Attiny13 using Arduino"

  1. Master, apakah bisa share referensi kode buat IR Remote pake ATTINY13, kalau pakai yang standart library arduino IRRemote.h file lebih dari 1KB jadinya tidak bisa pakai ATTINY13

    ReplyDelete