How to Program the ATtiny2313....

Hey there..!!

Today let us learn how to program the ATtiny2313 using the Arduino Microcontroller Platform. Let's Get Started...!!

For this you will need:

  1. ATtiny2313 of course
  2. Arduino (Any Model)
  3. USB Cable for Arduino
  4. 16 MHz Crystal Oscillator.
  5. Jumper Wires
  6. Breadboard

For testing purposes, you will need a LED and a 150-220 Ohm Resistor.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Getting the Required Files...

Programming the ATtiny2313 requires extra hardware files. Click the link given below to go to the web page of the files and download it.

ATTiny Core is the best hardware files to program any of the ATtiny ICs.

Unzip the file and copy the ATTinyCore-master and paste it in the hardware folder of your Arduino IDE.

Note: Make sure you close the IDE before you paste these files. If not closed, the files may not function temporarily ar the IDE may crash.

Step 2: Getting Your Arduino Ready....

Firstly connect the Arduino to the Computer and upload the ArduinoISP sketch which is available in the Examples.

Note: Make sure the Programmer Option in the Tools is set to AVRISP mkll.

Now set your Programmer Option to Arduino as ISP.

Go to the Tools Menu and change the Board as ATtiny 4313/2313.

Now go to the Tools again to see 4 additional options. Set it as shown:

  1. Initialize Secondary Timers: "no"
  2. B.O.D.: "B.O.D. Disabled"
  3. Chip: "ATtiny2313"
  4. Clock: "16 MHz (external)"

Step 3: Getting the Connections Right...

Connect the ATtiny2313 to the Arduino as shown in the Second Picture. Also, connect the Crystal to pin 4 and 5 of the ATtiny2313

Note: Upload the ArduinoISP sketch before you make the above connections.

Step 4: Uploading the Sketch...

Firstly, Burn the Bootloader into the ATtiny2313. This can be done by clicking on the Burn Bootloader option in the Tools Menu.

After it says done, you are ready to upload sketches to the 2313. Just open any code and Upload it.

Note: Not all sketches work on the ATtiny. They have their own limitations. For further information, please read the ATtiny2313 Datasheet.

First, try the Blink Sketch. Refer the Pin Diagram for the Arduino Pin Number on the Arduino...

Step 5: Yes, You Did It....!!

Now you can play with the ATtiny2313. Implementation of the ATtiny in other projects becomes easy. Now you can Program any ATtiny IC with this method. Remember, few ICs have lesser clock speeds. Overclocking the IC damages it. So, Take Care about it....

If you want to use your Arduino as a Microcontroller platform again:

  1. Change the Board option in your tools menu to the Board you have
  2. Change the Programmer Option from Arduino as ISP to AVRISP mkll

Now you are free to use your Arduino and your ATtiny...

Note: Disconnect the ATtiny before performing the above changes.

Maker Olympics Contest 2016

Participated in the
Maker Olympics Contest 2016

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    9 Discussions


    3 years ago

    For beginners which is the low end chipset in the Atmel family that you would recommend.

    2 replies

    Reply 2 years ago

    ATtiny Family is great for absolute beginners. But it lacks pins, memory and features which are required for larger projects.

    ATmega Family is great for General projects. They have a large variety of features, memories and no. of pins.

    ATxmega Family is great for advanced projects. They have a great performance, great memory etc.

    32-bit Family is for the powerful, IoT projects. They are packed with a large amount of power.

    The max clock speed increases from ATtiny to 32-bit.


    Reply 3 years ago

    It depends on your requirements. The Basic All-rounder is the ATmega328P. Mention your requirements to get my recommendation for the chipset..

    classic madhu

    3 years ago

    cam u also mail me the method to program lilypad without ftdi breakout board! using arduino!

    1 reply
    SagarA19classic madhu

    Reply 3 years ago

    Hey, Madhu..!! Similar to this process connect D13 to SCK, D12 to MISO, D11 to MOSI and D10 to RESET. Do not forget to connect the 5V power and GND. Download the Hardware for ATmega328P and Program it...