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

Okay just skimmed through all of the posts. Most of it didnt stick. I have a Q8 that wants TK’s candle+lightning mode bad enough that i’m going to try. Ordered parts!

I tried a lot of things and don’t know what is wrong. I get this error message when I testing connection with this command:
avrdude -p t13 -c usbasp -n

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9108
avrdude: Expected signature for ATtiny13 is 1E 90 07
Double check chip, or use -F to override this check.

avrdude done. Thank you.

My first thought is you have the chip name wrong. What light are you trying to flash?

Q8 and emisars have attiny85

avrdude -p attiny85 -c usbasp -n

After some googling, I think the “0x1e9108” signature indicates an ATtiny25. This page has a list of device signatures.

That means the programmer is detecting an ATtiny25, but you’re specifying an ATtiny13.

Does your driver indeed have an ATtiny25? If so, you’ll want to say:

If it’s tiny25, make sure to use fuse values which match tiny25 instead of tiny13. They are not the same, and bad fuse values can basically brick the MCU.

You’ll also need firmware compiled for tiny25, because the .hex files aren’t compatible from one to the other. Tiny25 code can be flashed on 45 and 85, because they’re the same family… but tiny13 and tiny25 are different families.

Thank you. It is a stock convoy C8 driver and I think I haven’t touched it so it should be tiny13. I will look at it tomorrow morning because now I’m at work. Maybe I mixed up my drivers and that answers everything.

I just did the same thing! guess i need to order another driver. for my next attempt is this the correct command?

avrdude -c usbasp -p t85 -u -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -Uflash:w:BLFQ8.hex

The cheapest option is to just order a single new attiny85 and change it out on the existing driver.

Here are the flash commands I use for 25 and 85

ATTINY 25: avrdude -c usbasp -p t25 -u -U lfuse:w:0xd2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -Uflash:w:Bistro-HD-Triple.hex

ATTINY 85: avrdude -c usbasp -p t85 -u -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m -Uflash:w:ProjectLunasolv3.hex

Thanks for another option. Id hate to replace the rest of the driver. Plus im only ok at soldering

FWIW, the repository’s bin/ directory has scripts to flash tiny13, tiny25, and tiny85. I recommend using those scripts instead of running avrdude directly, because the scripts are much less likely to brick anything.

still uncertain how to get from

https://code.launchpad.net/~toykeeper/flashlight-firmware/trunk

to

http://toykeeper.net/torches/fsm/

I’d suggest using the fsm branch instead of trunk, if you want the latest code. It’s newer but not as well-tested. Otherwise though, to build everything on a Linux computer, go into the ToyKeeper/spaghetti-monster/anduril/ directory and run the ./build-all.sh script.

On a Windows computer, it might be simplest to install an Ubuntu environment and do everything from there. It’s relatively complicated getting Atmel Studio configured.

I mean, people could also install a full Linux-based OS, but that usually doesn’t go so well. For new users, the process is typically something like this:

So for a new user it’s usually best to go with a more limited version in a container or VM, which is something Windows 10 supports now.

I ended up buying the driver because mouser and digikey was close to 10 dollars for shipping. But wish i saw this one sooner from aliexpress.

https://m.aliexpress.com/item/32213436059.html?pid=808_0000_0201&spm=a2g0n.search-amp.list.32213436059

Real cheap. Might still just to fix the old driver.

Help wanted.

I would like to burn the program into NANJG 105 8x7135 linear regulator driver.

I need only BECON mode 2sec on 2 sec of .
I can only find a programs that have a lots of programs but you have to switch it to mode, but I need only beacon mode.

It could be a code from DR Jones LUXDRV 0.22

Could someone make the change to activate only beacon mode? I can make the HEX file.

Thank you

My replacememt Q8 driver finally came in. Flashed Anduril before swapping out the old bricked one. Thank you to Hoop for the write up and Toykeeper for the firmware. The whole process was simple and easy to follow. When im not using the light i set it to the lowest brightness momemtary just in case my 2yr old son grabs it.

hi im getting

avrdude: warning: cannot set sck period. please check for usbasp firmware updat
.
avrdude: error: programm enable: target doesn’t answer. 1
avrdude: initialization failed, rc=–1
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

anyone have any idea what this means?

it was cheap sioc clip from amazon and by looks of it it isnt making physical connection, the pins look too short.

ignore this: avrdude: warning: cannot set sck period. please check for usbasp firmware update

try wiggling your clip or reseating it…i had success with the amazon parts…

if wiggling doesnt work, reexamine your wiring to the clip…

also…pay attention the orientation of the clip to the chip

there is a small circle/triangle near one of the chip legs…this indicates where the clip goes…in the picture it is the lower left leg…see the small triangle/circle? make sure the clip (if correctly wired) has the RESET clip prong on the lower left leg (in the pic) or on the leg with the circle/triangle if the chip is oriented different than the picture.

scroll down this OP link:

What these wires are, functionally, is detailed on the flashlight wiki and in the USBasp V2.0 users guide.

1) MOSI
2) VCC
3) GND
4) TCK
5) RESET
6) RXD
7) SCK
8) GND
9) MISO
10) GROUND

The pins of the ATMEL ATtiny13A chip itself on the driver are as follows:

  1. RESET
  2. INP
  3. INP
  4. GROUND
  5. MOSI
  6. MISO
  7. SCK
  8. VCC

a successful flash (depending on what you are doing) will look like this:

found the directory to put the hex…flashed:
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0×1e930b
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file “anduril.2018-08-22.EMISAR_D4S.hex”
avrdude: input file anduril.2018-08-22.EMISAR_D4S.hex auto detected as Intel Hex
avrdude: writing flash (8026 bytes):
Writing | ################################################## | 100% 5.73s
avrdude: 8026 bytes of flash written
avrdude: verifying flash memory against anduril.2018-08-22.EMISAR_D4S.hex:
avrdude: load data flash data from input file anduril.2018-08-22.EMISAR_D4S.hex:
avrdude: input file anduril.2018-08-22.EMISAR_D4S.hex auto detected as Intel Hex
avrdude: input file anduril.2018-08-22.EMISAR_D4S.hex contains 8026 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 4.37s
avrdude: verifying …
avrdude: 8026 bytes of flash verified
avrdude: safemode: Fuses OK
avrdude done. Thank you.

nah the metal contacts in the end of clip arent even touching anything.

it keeps pinging off.