Guide: how to flash ATtiny13a based drivers (NANJG, QLITE, etc.) with custom firmware

Don’t bother with the erase step. It’s not necessary at all.

I’d suggest using bin/flash-85.sh or copying the commands from that file. It has the fuse values and other options most projects use, and is known to generally “just work”.

to reveal a bit of my knowledge on this subject, I have no idea where to find the file flash-85.sh Is this a command somewhere in the programming line, like
avrdude -p t13 -c usbasp -u bin/flash-85.sh ?

The flash-85.sh file is located in ToyKeeper’s flashlight firmware depository inside the /bin folder. Its avrdude command reads:

Change FILENAME.hex to your .hex file’s name.

Note the ‘t85’ option. This sets the chip model to ATtiny85. Your example shows ‘t13’, which is erroneously specifying an ATtiny13.

I mentioned in your other thread that before sending your new firmware, you can test your connection between the ATtiny85 and your programmer with this command:

If the connection test is unsuccessful, you may need to fiddle with your clip. I have a cheap one that sometimes needs a couple of tries. :slight_smile:

It looks like you’re getting close to a successful reflash. Keep at it, and keep us posted! :+1:

Hey goshdogit, thanks for all your help. I guess I really should have kept all this in one place, it would have helped me keep track of it. :blush:

I was able to connect using the ‘t13’ command, but got some minor errors. using the t85 came out a bit cleaner it seemed. I still get a warning about ‘cannot set sck period. please check usbasp for firmware update’, but the device signature comes out ok and I get the safemode Fuses ok message, much better. :+1:

I have been practicing with a demo board with a t85 chip on it before disassembling my D4. I connected the clip backwards to the demo board yesterday :person_facepalming: but it seems like it survived that.

After a couple of false starts on gettting ‘filename.hex’ correct, it looks like I successfully flashed the demo board. :beer:

Next step is my D4 . . .

success!!

Nice! :partying_face:

I put a small dot of silver marker on my clip to mark pin 1’s location, and another on the ATtiny85 chip. It makes it easier to attach the clip correctly.

I get that ‘cannot set sck period’ error, too. I’m not sure what it means, but it doesn’t seem to cause any problems. I’ve flashed over a dozen lights several times without issue. Perhaps someone with more experience can chime in about it.

It’s my understanding that these USBASP boards set SCK automatically and the error is really just a advisory.
Perfectly normal. Just ignore it.

After reading this thread, I managed to disassemble my D4 and flash Anduril successfully, but got in a hurry when attempting to flash my Q8 and used the wrong fuse vales :person_facepalming:

The only led that still works is the green button led, and the ATtiny 85 isn’t responding. Any ideas on the best and/or cheapest way to fix this?
From what I’ve read it seems like my only options are either building a high-voltage avr programmer (which I do not think I have the knowledge to do) or get a hold of a completely new Q8 driver…

New drivers are 10 bucks.

BLF Q8 Driver Chip Q8 Circuit Board
http://s.aliexpress.com/ZbyUBBBZ

Thanks! One’s on the way, $10 is quite a bit cheaper than I thought a q8 driver would be :+1:

OMG! I CONNECTED!!!
Cheaped out and bought the pre-wired clip from wherever, have never been able to connect.
Did all of the driver signing stuff with Win10, been at this for a while.
Finally desoldered the wires and did it myself and I just got the most beautiful response to avrdude -p t13 -c usbasp -n

There’s still a lot to be done, but I’m happy to be past that.
Thanks to all who’ve contributed!
Robert

:slight_smile: :beer:

can you post a picture of your usb setup?

thanks!

It won’t help much as it’s all covered in heat-shrink, but I’ll explain how I did it.
The one I ordered off ebay is black and has 8 grey wires coming out of it. I peeled back the heat shrink and de-soldered the wires.
I tinned the relevant pins and soldered the colored ribbon cable, matching the colors so there would be no confusion.
Attached the black clips to the USB adapter and it works.

I feel like a script kiddie, I just installed the pre-built Anduril on my D4 and am giddy with excitement!

If my description doesn’t help I’ll post a picture. And I finally broke down and used a USB extension cable as suggested. Little tip, big help. MUCH easier making sure the pins are exactly where they need to be.

ya, a picture of colors and wiring would be helpful. as well as the usb device and clip

and links to the parts…

thanks!

I just clicked on the links provided in the OP. Skip the clips with the cables attached and use the ribbon cable in the fasttech link instead.
It won’t let me copy/paste so just check the Required Hardware section in post #1, that’s what I did.
Of course this method requires some wait time, but there’s plenty to read before starting.
I took the easy way and used preconfigured hex files from toykeeper so I didn’t screw anything up.
I would post a link to that but my damned KVM is messing up and I can’t type on my other computer and I’m shutting my regular computers down now because it’s driving me crazy trying to type.
oh wait, here it is: Index of /torches/fsm

Well this is ugly but here it is:

Thanks!

Hoop, could you remove this part? It’s not necessary to erase the chip before flashing, and a couple people reported that erasing it made the chip stop responding entirely. I’d rather not advise people to do something which might brick their hardware.

It’s probably also worth noting somewhere that the t13 part will change depending on the hardware, and tiny85 is pretty popular lately. Tiny13 settings won’t work on tiny85 hardware, and they use totally different fuse values.

where is the Atmel Studio I can find it at the link in the first post!!!

http://www.microchip.com/mplab/avr-support/atmel-studio-7

wow thats a large download!!!

ok so web installer allows me to install 3 parts… which one is needed???