I found working with atmel studio is little bit difficult. Atmel studio is a heavy software, takes too much compiling time, occupies much of the system ram, libraries are not well explained and above all the helping community is small. So i decided to program atmel attiny series microcontrollers with arduino ide. Arduino ide does not directly support atmel attiny series microcontrollers. In order to make attiny series programmed with arduino ide. We have to install some plugins in arduino ide system files. In this post i will explain how to install the attiny series plugins for arduino ide and what changes we need to make in arduino system files to make attiny series recognized by arduino ide. After installing the series compatibility i will explain a small project that i made using atmel attiny13a microcontroller. I programmed the attiny13a microcontroller with arduino ide using an external programmer usbasp. I also programmed and attiny13a microcontroller with a stand alone arduino as icsp.
Extract the .rar file. You will get a folder named attiny13. Locate your arduino files installation directory. Find the Hardware folder in the arduino installation directory. Usually it is at C:\Program Files (x86)\Arduino\hardware. Place the attiny13 folder in the hardware folder. Restart the arduino ide and under the boards option you will now find the attiny13a options. Attiny13a will be listed with five different clock configurations. All the configurations are using attiny internal clock source. I checked all the clock sources and they are working fine. But some users on internet say that they find difficulties in generating proper delays. I checked the delay() function for each clock source and it worked for me properly.
Blink led with Atmel Attiny13A, Arduino Ide and Proteaus Simulation
To prove that the upper configuration works i made a simple blink led project/program. Led toggles at very half a second. I connected the led to pin#PB4 of attiny13a. I used an internal 4.8Mhz crystal as clock source. On reset pin i connected a push button for resenting the microcontroller to run over again. Whole of the circuit is powered using a CR2032 cell. Cr2032 is a 3.3v coin cell. Attiny consumes very little power during operation. Atmel attiny series microcontrollers are considered to be the master’s of hibernation. They can remain in hibernation for years with very minute amount of power supply. Circuit diagram of the project is given below.
Programming Attiny13a with UsbAsp Programmer
To download the code in the microcontroller i used Usbasp external programmer. Attiny13a can be programmed by using its icsp interface. The connection diagram of the attiny with usbasp programmer is given below. Usbasp can program at Vcc= 3.3v and 5v. You can select the voltage level using a jumper installed on the usbasp programmer. I selected the 3.3v. Since i am running the attiny with cr2302 coin cell rated at 3.3v. Its better to work on the same voltage level. But you can also program it at 5v.
Note: If using an external programmer such as usbasp the code can only be uploaded to microcontroller by using the Sketch>Upload using Programmer option. |
Before Programming the attiny13a please make sure that you selected the right programmer from the programmer drop down menu.
|
Programming attiny13a using Arduino uno as Isp
Attiny13a can be programmed using arduino uno. Code can be uploaded using the following simple steps.
- Connect arduino to PC.
- Select the right Port and arduino board, in our case “Arduino Uno”.
- On arduino upload the sketch “ArduinoISP” given in the examples. Wait for sketch to be uploaded. Once uploaded move to next step.
- Select “Arduino as ISP” from the Programmer drop down menu.
- Select the right Port.
- Select the “ATtiny13A standalone 4.8Mhz” from the Board drop down menu.
- Open the sketch you want to upload to the attiny13a and upload the code by pressing the upload button.
Download the project code and simulation. Simulation is made in proteaus. The code folder contains the arduino code file and .hex file that can be burned to microcontroller directly for blink led program. Please give us your feed back on the project.
Watch the Project Video Here…
Filed Under: Arduino Projects, Microcontroller Projects
Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.