How to Program ATtiny2313





Introduction: How to Program ATtiny2313

Howdy folks!

When I first got my ATtiny2313 it took me the better part of 4 hours to finally get it programmed. I went through countless tutorials online that were old and outdated. I was never able to get the correct files from one website. I had to combine the files from several websites before I was finally able to program my ATtiny.

NOTE: With the recent update of the Arduino IDE I can't figure out how to get the boards to show up in the list. I'm sure it's easy and I'll figure it out in a bit. For now you are still going to have to use the old version of arduino for programming any ATtiny chips.

The goal of my (Current and Updated!!!) series is to find tutorials online that are old, outdated, or nonworking and make a new tutorial that I have tested and used myself.
My first i'ble in this series is how to use IR remotes to control your Arduino.
I will keep updating my i'bles in this series to work with new Arduino boards, IDEs and the like.

Now I've never tested this process on a windows but I know that it works on a mac. It should be the same for windows, just delete any mac content in the zip.

Step 1: Download the Files

First you need to download the boards information for the Arduino IDE. This file will need to be downloaded in order to program a ATtiny2313.

Once you have downloaded that you will need to extract the 'tiny' folder to your Arduino hardware folder. Now if you don't know where that is or if you don't have it here are the steps.

  • Go to your Arduino documents. This is where all the sketches are saved (by default).
  • For mac users it's Macintosh HD>Users>username>documents>Arduino.
  • Create a new folder and name it "hardware", just like that. Into this folder you will put the 'tiny' folder that you downloaded.
  • For PC usersProgram Files(x86)=>Arduino=>hardware. Copy the 'tiny' folder into it and restart the Arduino IDE.Delete the extra mac content.

Step 2: Upload the ArduinoISP

  1. Connect your Arduino to your computer.
  2. Open up the ArduinoISP sketch which is with the other example sketches.
  3. Upload it.

Step 3: Connecting the ATtiny2313 to the Arduino

Make the following connections. You need to be sure that you are connecting these to the ATtiny's actual pins (starting from the top left and counting up counter-clockwise) and not the name of the pin.

  |                   |
5v------------>20 VCC
GND-------->10 GND

Also add an LED with a resistor on the pin (#7) right next to the GND on the ATtiny2313

Step 4: Uploading and Enjoying!

  1. First make sure that you have already uploaded the ArduinoISP to the Arduino.
  2. Select the (ATtiny2313@1MHz) board. When you go to boards you will notice that you will have a lot more options to use. This is because that 'tiny' folder that we put in the 'hardware' folder gave the Arduino program more board options.
  3. Under 'programmer' select 'Arduino as ISP'.
  4. Open the blink sketch and change the led pin 13 to pin 7.
  5. Click the upload button and pray!
Once you upload it you should have no errors. If you connected the Attiny to the Arduino incorrectly, it'll bring up the an error and it will say 'double check connections'.

After upload your LED should start blinking! Congrats! You now know how to program your ATtiny2313.

  • LED does not blink
    Make sure that you have connected the LED to the proper pins.
    Make sure that in the blink sketch you change the 13 to '7'.
    Replace the LED and try with another one.
  • Unable to program
    Make sure you have properly download, unzipped, and placed the 'tiny' folder.
    Make sure your 'hardware' folder is in the correct place.
    Make sure that you have selected 'Arduino as ISP' under 'programmer'.
    Make sure that you have selected the correct board. The correct board is the 'ATtiny2313@1MGz.

Step 5: Conclusion

I hope this i'ble was able to help you program you chip. You should be able to do this for ATtiny4313. Now I have not actually tried it myself but I will as soon as I get that chip.

Please give it a vote for the microcontroller contest!

and. . .

Don't forget to favorite and subscribe!



  • Epilog Challenge 9

    Epilog Challenge 9
  • Paper Contest 2018

    Paper Contest 2018
  • Science of Cooking

    Science of Cooking

We have a be nice policy.
Please be positive and constructive.




I cannot work out how to fix this error message: avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.

Is there any one way to fix this? I've read that I may need to use an external clock, which would make sense as I acquired my 2313 from a Maplin DIY alarm clock kit, but I though perhaps it wasn't necessary...

Any ideas??

Hello SpikeSmall,

Connect a 10 uF capacitor between “Reset” and “Ground” pins on the Arduino Uno board as shown in the diagram. The stripe of the capacitor with the negative sign (“-”) goes to the Arduino “Ground” pin. This prevents the Arduino Uno from resetting and ensures that the Arduino IDE talks to the ArduinoISP (and not the bootloader) during the upload of the sketches to the ATTiny.

I think this is the problem.

Grz Ruben

Thanks for the reply, but I still get the same error.

I used a 100uf capacitor instead as it was the only one I had.


Same error here

Hello, noobish question, can i program ATtiny with an Adruino Micro or Nano ? Thanks !

Yep you absolutely can. Just look up the pinout, you will need +5v, GND, MISO, MOSI, RST (Reset) and SCK.

hello sir can i use atmega328p as attiny ?i mean can i run attiny code on atmega328p and does it work??

Yes you can use the Arduino language across it's different chips, just keep pinouts in mind. Some various libraries won't work with certain chips too, so keep that in mind.

hello sir thnx for ur answer.i want to make wheel spoke pov light.and i finally found in adfruit.but problem is they use attiny 2313 chip and attinyusbisp for programme.but here i cant found this kind of chip here.and my question is how can i run same code in atmega 328p and run code same as attiny 2313. what is different between usbasp and usbisp....

this massage continuously showing while i programming delay sketh why?

i have done all correct connection and setup as shown above. want a solution.

Arduino: 1.8.3 (Windows 7), Board: "ATtiny2313 @ 8 MHz"

Warning: Board tiny:avr:attiny2313at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY2313AT1

Warning: Board tiny:avr:attiny84at16 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT16

Warning: Board tiny:avr:attiny84at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT8

Warning: Board tiny:avr:attiny44at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY44AT8

Warning: Board tiny:avr:attiny25at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY25AT1

Warning: Board tiny:avr:attiny2313at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY2313AT8

Warning: Board tiny:avr:attiny24at16 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY24AT16

Warning: Board tiny:avr:attiny85at16p doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT16P

Warning: Board tiny:avr:attiny45at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY45AT8

Warning: Board tiny:avr:attiny4313at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY4313AT8

Warning: Board tiny:avr:attiny85at16e doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT16E

Warning: Board tiny:avr:attiny44at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY44AT1

Warning: Board tiny:avr:attiny4313at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY4313AT1

Warning: Board tiny:avr:attiny85at128 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT128

Warning: Board tiny:avr:attiny45at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY45AT1

Warning: Board tiny:avr:attiny25at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY25AT8

Warning: Board tiny:avr:attiny85at8 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT8

Warning: Board tiny:avr:attiny85at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY85AT1

Warning: Board tiny:avr:attiny84at1 doesn't define a 'build.board' preference. Auto-set to: AVR_ATTINY84AT1

Warning: platform.txt from core 'Arduino Tiny' contains deprecated tools.avrdude.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude, automatically converted to tools.avrdude.cmd.path={path}/bin/avrdude. Consider upgrading this core.

Warning: platform.txt from core 'Arduino Tiny' contains deprecated tools.avrdude.config.path={runtime.ide.path}/hardware/tools/avr/etc/avrdude.conf, automatically converted to tools.avrdude.config.path={path}/etc/avrdude.conf. Consider upgrading this core.

Warning: platform.txt from core 'Arduino Tiny' contains deprecated"{compiler.path}{}" {} "{build.path}/{archive_file}" "{object_file}", automatically converted to"{compiler.path}{}" {} "{archive_file_path}" "{object_file}". Consider upgrading this core.

Warning: platform.txt from core 'Arduino Tiny' contains deprecated recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm, automatically converted to recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} -o "{build.path}/{build.project_name}.elf" {object_files} "{archive_file_path}" "-L{build.path}" -lm. Consider upgrading this core.

exec: "avr-g++": executable file not found in %PATH%

Error compiling for board ATtiny2313 @ 8 MHz.

This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.