Arduino ISP help

Hello! I bought this device on ebay and managed to programm ATTiny2313 using Arduino IDE.
How do I write on ATTiny2313 a hex file that I have already?
Thanks! :~

You can use avrdude from a commandline.

This line will upload blink.hex to a t2313:

avrdude -p attiny2313 -c stk500v1 -P COM3 -b19200 -Uflash:w:Blink.hex:i

If you enable verbose output in the Arduino IDE, you will se a line similar to the above.

An avrdude tutorial can be found here:

I installed WinAVR ... after restart I put in C :confused: Windows folder code.hex file.
I connected the Arduino to the computer on COM3 - I installed Arduino1.0.3 and I uploaded ArduinoISP from Examples.
I disconnected the Arduino from the computer and I installed AVR Programmer bought on Ebay .
I uploaded blink of examples / basics and works - LED conected on pin 7 blinks
Then I typed Run - cmd - avrdude-p-c ATTiny2313 stk500v1-P COM3-b19200-Uflash: w: code.hex: ENTER and I got the error in the picture attached here
Please help me with a step by step tutorial :frowning:

Hi - You need to use an external program - you may want to have a look for AVRDUDE (its in the arduino folder under \hardware\tools\avr\bin) - and a copy of avrdude.conf (found in hardware\tools\avr\etc)

To make things easier, I recommend finding a GUI - I use the one attached (from - there are many posts here, and on other sites to add support for other AVRs if required to avrdude. The programmer you should use is 'Arduino' - Hope this helps.

Drew (11.8 KB)

Are you sure your programmer is connected to COM3 (look in your Arduino IDE tools)?
To test your connection try this:

avrdude -p attiny2313 -c stk500v1 -P COM3 -b19200 -v

and remember to change COM3 to whatever you are using

You could try to use arduino as programmer as proto-pic mentions like this

avrdude -p attiny2313 -c arduino -P COM3 -b19200 -v

I used these settings for the avrdude-GUI and when I press the Write or Erase-Write-Verify gives me this error
I wrong somewhere? :frowning:

I can see that you are vstill using COM3.

Did you veriy that ths is the correct port ?


You need to specify the baud rate to avrdude.

Add this to the Command line Option window.


@ catcher.. What's a bug? and what happens...?

The GUI doesn't work correctly when the "Display Window" box is checked when Flash reading or writing. For some reason it has trouble with the Windows file paths. Works fine with the box unchecked.

OK and Thank you in advance... Tinys have become very interesting to me...
Found this programmer (PCB) ATtiny Programmer Adapter – insideGadgets Shop
$4.00 for a bare PCB and it looks Nice... Too.


Instructions with the GUI?... I "lost it" after I downloaded it..


We succeeded! :slight_smile:
I tell you how I did it.

  1. I created a Windows Batch File with the following instructions:
  2. I put the batch file (in my case main.bat) and main.hex in the same folder.
  3. We connected Arduino ISP programmer mounted on COM3.
  4. We executed main.bat and ready

How to erase the chip now ?

From the tutorial:

-e: This erases the chip, in general we don't use this because we auto-erase the flash before programming.

so something like this:

avrdude -p attiny2313 -c stk500v1 -P COM3 -b19200 -e

After writing a code.hex the ATtiny 2313 can not be erase - it gives me this error:
Code can contain the write protection?
We can fix the chip in this case?
This is the code I was talking about:
It can remove write protection with notepad?

No, code cannot write protect by itself. The only way is by setting the fuse lock bits. But even if the lock bits are set, the chip erase will override that and reset those bits.

When the device signature is all 0xffffff the something is wrong with the chip. Did you install it backwards?

What was the last fuse settings you used? Are you using internal clocking or external?

I know the ArduinoISP does not support slow clock rate below 1 MHz. If you had set the low fuse bits for internal 128KHz clocking then the ArduinoISP won't be able to program the chip. However, usually that results in a failure to read the device signature as all 0x000000. So this is probably not the case.