howto: flash ATtiny with AVRDude and command prompt

Yup, you are right

So with the *.hex being the next file in the directory, it becomes argument variable %1 automatically…good call

I had 3 different .hex files in the directory, so I manually go in and edit the.bat just to make 100% sure I ain’t doing something wrong…lord knows with my luck I would run the *.bat and erase 90% of my drive or something

No, it doesn't automatically choose any hex file, that's the point of it; you choose which hex file you want to flash by which name you put after typing flash. I have about 50 in my folder, this makes it easier for me. You don't ever need to edit the hex file unless you are flashing one with different fuses.

I’m supposed to move the jumper to 3.3 not leave it on 5?

gotcha…by typing the name you are setting the variable…duh

this is why you guys are the masters and I am still learning :smiley:

Yes

I think that mine is still on 5, has always been on 5. Came that way, I figured that it was setting the input voltage but that was just a guess (USB standard is 5V).

I believe jumper is for VCC going to the ATtiny 13…I guess 5vdc would work, but I set mine to 3.3

Per the data sheet
Operating Voltage: – 1.8 – 5.5V

https://www.dropbox.com/sh/s2rll5mwqnjtcki/kb50msUgkK

I guess it doesn’t matter

Very carefully identifying each wire at the mcu, then attaching that wire to it’s proper point in the plug going into the usbasp. No dice. Changed the jumper. No. Tried a brand new driver. Nope. Even with the clip actually on an ATiny13A, on top of the diagram, tracing that wire to the block, everything looks perfect. No deal.

Bedtime, again.

Found this, in case anyone is looking

http://letsmakerobots.com/node/36841

Crazy question…do you have WinAVR or avrdude installed?

http://winavr.sourceforge.net/

Not needed - as others already said, both positions work fine

Everything now seems to be working properly, so I have to figure out the flash part. Then I’ll be good to go, until I wake up tomorrow and have to start all over…

Ok, I edited the Flash.bat file from Comfy to read the actual .hex file I just created a little while ago. I plugged in my USB Programmer with a driver attached to the clip and then double clicked the Flash.bat file…BAM! so much happened so fast then closed that I am not sure what it did! lol A command window opened, lots of stuff flashed by, then it closed. So, am I to assume that this driver is now flashed? Easy as that? Daaaaang! :slight_smile:

This was a blown driver, so I can’t test it, but I now know that when I double click that file stuff happens! Still have to find out if it’s the right stuff… No FET boards yet, guess I’ve got to get busy and strip down a Qlite and put an FET on it the hard way, find out if all this works.

Confusing, exasperating, exciting and rewarding, what a mixed bag!

To see what happened when running the bat-file you can add a line to the end of the file:

PAUSE

Then the window stays open until you hit a key.

It ran by so fast and then closed, I have no real idea what happened until I put it in a light. Working on that part as we speak…

Copy the command string from the .bat file and paste it into the window, that's how you should be doing it until you know for sure it works. And use the 'test connection' string if you're still figuring out if it's wired right:

avrdude -p t13 -c usbasp -n

-----

I have the same USBASP programmer from FT as most everybody else, but it's never worked for me with the jumper on 3.3v. Moved it to 5v and it works fine.

I used that test string as provided by the Wikipedia and finally got it all working this morning. Just flashed my first new Qlite, then stripped it and put an FET on it, am seeing 5.90A with no bypass in the driver spring…from an Efest 35A 18650. :slight_smile:

Thank y’all so much for bearing with me! This has been certainly interesting, if not frustrating. But the reward sure feels good! :slight_smile:

Edit: Bypassed the driver spring, how about 6.61A from the Efest 35A!!!

Just double clicking the .bat file runs the command, since there isn’t a stop command it does it and closes when complete…this is why opening a static command prompt to run the command is usually the way to go otherwise it opens does it’s thing, then closes

as above add the pause string above will cause it to stop and wait once it completes the command string

If you know you have a working .hex file, and have reasonable certainty everything is still good on your programmer/cables/clip, you can use the .bat file method with no issues. If for whatever reason the flash doesn't work the window closes REALLY FAST! and it's pretty easy to tell if it worked or didn't.

But yes, for the first time with a new file, or after making changes, open the command prompt manually and paste/type in the commands. Once you've verified it works you can whip up a .bat file to go with each new version so you don't have to do all that mess every time you want to flash the same one again.

Question for DBC. You went to bed at 2.58 (all my time) posted again at 3.10, 5.07, and 6.29. How much sleep do you live on?

Being a flashaholic, he can not sleep until the problem is solved.