howto: flash ATtiny with AVRDude and command prompt

Here it is:
https://dl.dropboxusercontent.com/u/23983522/usbavr.bat

posting from a phone so I can't see that.

Copy/paste it here.

Also are you changing the directory to your AVRUSB folder using the CD command?

I was following the instructions from the first page
Here is the bat content:

This is what I type in CMP and yes I am using CD command

And where do you have the avrusb folder, directly in C or inside another folder?


i see an issue with your bat, getting to my computer now, check back in 5min.

It is in the root of C:
here is the screenshot of the whole story:

Okay first change your .bat file to te code belpw

then rename it to "flash", not "flash.bat", just "flash"

then open CMD and type CD C:\AVRUSB

this will set the directory

then with the hex file in the AVRUSB folder with the newly renamed BAT file type this:

FLASH [the name of the hex file]

there can be no spaces in the name of the hex file and also dont add .hex to the name either (either when naming it or when typing it in cmd)

avrdude -p t13 -c usbasp -u -e 

avrdude -p t13 -c usbasp -u -Uflash:w:%1.hex:a -Ulfuse:w:0x75:m -Uhfuse:w:0xFF:m

Also while youre at it can you test the connection NOT using the bat file?

 avrdude -p t13 -c usbasp -n

I am getting the same error at the end. The connection seems to be ok. Here is the screenshot:

The driver now is dead :frowning:
I will try it on other PC

Do you have a different driver? Was it a new build or a reflash of a store bought driver (and if so where did it come from)? Have you ever successfully flashed another one before or is this your first?

I've never had it happen to me but it looks like that ATTiny13A may be locked.

it looks like the connection is good, can you try just an erase with this-

avrdude -p t13 -c usbasp -u -e 

The driver was new and it was working, I tried it just before flashing.
I’ve ordered from here:
https://www.fasttech.com/p/1186301

Here it is the erase:

That looks ok, you can ignore the clock warning, is the hex your trying to flash one you've compiled or a version of nlite you downloaded?

I succeeded, the driver is working again. :slight_smile:
I’ve changed the jumper to 3.3v it was at 5V.
I don’t know now what helped me, that jumper or your erase?

@Cereal_killer
Thanks a lot for your help!!!

Ah such simple stuff its easy to overlook!

glad its working for you.

I’m glad things are working. @Cereal_killer - you should not need to rename the batch file. blah.bat is fine, you can still execute it without the extension like:
blah [the name of the hex file]

Yea it can be named whatever you want but when its renamed flash its easy to remember cause its like your just telling it to flash a file like you talk. I know it doesnt really matter but to me its just easier to remember, when I want to flash a file I just type:

CD C:\AVRUSB

then “FLASH FET_STAR_E12_V6” for example. The main thing to remember is dont add .hex (or any other extension) when naming or flashing and dont put spaces in the hex files names.

Is it possible a lightning storm could of taken out my programmer?

up till this morning my programmer was working fine then we had a huge lightning storm, the house lights never went off or anything but now I cant program chips, I’ve tried everything even soldering the ribbon cable from the programmer directly to the chip (tried 3 different drivers, even tried a bare chip) and all the drivers are working fine, just cant reflash them. I also verified continuity between the actual legs on the programmer (not the socket, the leg from the back of the socket to the board) to the end of the ribbon cable.

Could a surge/electrical spike have taken out my programmer? It was plugged into USB and powered on the whole time. It seems crayt but I’ve been messing with it a few hours now and cant get it working again, I’ve redownloded the drivers, checked my bat file, everything is right it just doesnt work.

this is what I get when trying to test the connection, this particular time was with a bare chip but its the same when trying with a complete driver-

oh and yes the jumper is on 3.3v

Could baud rate be affecting it…I remember seeing somewhere (don’t remember where) but baudrate might make it talk better to the ATtiny

do you have any stars soldered down?

Maybe a force?

Oh wait RC-1 means the USBAVR isn’t talking to the chip

Never seen this before

avrdude -c usbasp -p t13 -t -vvvv

its definitely got a good connection, the leads are soldered direct to the chip legs and no the stars arnt connected.

its looking more and more like my programmer bit it, tomorrow I will try a different computer before giving up and ordering another.