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

I only know of ToyKeepers Crescendo
I think she said it works a bit clunky. For ramping you really want an e-switch.

I’ve tried the Attiny13A version of Cresendo firmware, the stock one doesn’t have memory and lacks some functions though.

There’s a dr Jones open source T13 clicky ramping FW. It has a few preset levels and a ramp but you can easily comment out the levels part.

I don’t remember what it’s called, been YEARS since I’ve used it but it definitely does exist. I actually still have it in a few old lights.

It’s not fancy, but there is another:

https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files/head:/gchart/ramping-ui/

It’s made for clicky lights with the qlite/nanjc105c style drivers (single-channel, attiny13a). It has a few in-light config options:

  1. Memory toggle
  2. Stop-at-the-top toggle (without any user interaction, stops itself at turbo)
  3. Turbo Timer Toggle (turbo steps down to 50%)
  4. Reset options

Default is no memory, ramps up and back down until you stop it with a half click. Double-tap to go to turbo. Triple-tap for an 8-bar battery check. No blinkies, though there is room to add some in (~150 bytes, I think). Ramp speed is currently ~7s (I think) from bottom to top with slight pauses at both ends.
The ramp speed is pretty easy to change as long as you can compile the code.

Could I use an Arduino Uno instead of a USBasp?

Just because I already have one and would only need to get the clip.

Hello,

I found alexvh’s firmware
https://budgetlightforum.com/t/-/31290
with ramping UI and tail-click.

I was able to flash it into my Convoy S2+ Njang driver:
https://budgetlightforum.com/t/-/30672/557
and it works properly.

Also this firmware has a big bonus: it uses off-time to switch modes (without a need to solder additional capacitor) .
In my opinion it is great feature in comparison to ordinary 3/5 stock soft.
However I had to tune source code a bit to meet my needs (not a big deal though).

At the beginning I wanted to use biscotti firmware, but for some reason it doesn’t work on my driver.

Hi all,

I am trying to get my Windows machine connected to my Q8 using avrdude in order to flash Anduril to it.

The problem is that I’m failing at the first hurdle. I just get “initialization failed, rc=–1” when testing the connection.

I couldn’t find any specific information on the pinouts for the attiny85 MCU in the Q8, only attiny13, i.e. here: AVR Drivers - Flashlight Wiki

So I copied the pinout there. I have an “old version” USBASP device.

When I connect my SOIC clip the Q8’s button illuminates, and it flashes when I run the test script, but that’s it.

I’ve tried disconnecting and reconnecting the clip a hundred times.

Am I doing something silly? I’m new to this firmware flashing lark!

Thank you.

The best advice I can give you is to make absolutely sure your pins are connected in the right place,
The easiest for me was to use both devices pin out and match each wire to the appropriate location.
First find the pin out for the programmer, google has plenty of info like here. How use the ICSP port with the USBasp programmer under linux to burn the bootloader | Details | Hackaday.io

Then find the pinout for the attiny85, usually found in the datasheet or do a google search for “attiny85 pinout”. https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf

Find pin 1 on the programmer (MOSI marked with a triangle) and match that to the attiny85 MOSI pin (using the notch or dot as the reference to pin locations). Do this for the other 5 connections. Run the avrdude connection test if you get a error, check your wiring again very carefully using both device pinouts. It’s almost always in the wiring.

13a 25 and 85 all have the same pins

What command are you using to flash?

You were right. It was the wiring. Two of the pins were shorting where I connected them to my clip. All sorted and Anduril flashed! Now to wait for my D4S to arrive!

I’m running into a problem I haven’t seen before. In the past I have successfully flashed FW to attiny13 and attiny25 using a different computer (windows 8 I think). Now I’m using a windows 10 computer with the same flashing hardware as before. I’m trying to flash crescendo on a attiny25, but first I’m flashing battcheck-25 to get the voltage readings correct.

It seems to be connected properly.

Then when I go to flash the battcheck hex I get a verification at the end, “verification error, first mismatch at byte 0x0000
0xdf != 0xff”

The hex did not seem to be properly flashed, and this error seems to have bricked the chip. I can’t connect to the chip anymore. I tried the process again on another attiny25 not connected to a driver and the same thing happened. Does anyone know how to fix it? Thanks for any help.

EasyB: I haven’t run into this error, but I’d double check what fuses you’re trying to flash.

In TK’s T25 fuses flash script, she uses L:0xD2, H:0xDF, E:0xFF

Using this Fuses Calculator, going from 0xDF to 0xFF for the High fuse would disable SPI (serial programming and data downloading). I really don’t think you want to do that!

Edit: the fuse settings you have are appropriate for the T13A. Careful there, cowboy! I’m sure you know this, but fuse settings can’t be used outside of the same chip family. T13A is a different family than T25. Now T25, T45, and T85 - those are all the same family, so the fuses are the same.

Thanks, I used those fuses and it seemed to flash successfully. I don’t remember using different fuses for 13 and 25 when I did it years ago so I didn’t think to look very carefully at them. Lesson learned. :person_facepalming:

I got round to flash Anduril onto my D4S and I think I bricked it.
I just simply copied the command from the first post without reading more about it and now I wish I did…
That’s what I did. Now after pressing the button only aux LEDs blink in low mode.

Can I still resque it or do I have to replace ATTiny on the driver?

Forgive me if that’s something obvious but I’m really not too educated on this stuff…

It may need to have the attiny replaced. The fuse values shown were for a different chip, and it may have put the attiny85 into a locked or otherwise unflashable state. :frowning:

Is one of the required softwares Amtel studio 7? Guessing that is the latest version.

If you’re using Windows and want to use a graphical interface, then yes… AS7

Good, just trying to get my ducks in a row. I have the equipment in my cart at fasttech a/w the 20% discount sitewide which starts tomorrow. Looks like it may be quite the task but I’m going to give the Anduril flash a try.

So i set everything up. USB drivers, AS7 and AVR Tools. Programmer is connected with the SOIC clip. And now i am searching for the right files to update my FW3A with toykeepers new version.
I read somewhere that the temp controll was written almost completly new. This is the part that interests me most.
Can someone give me a hint which one it is?

So read a bit and looked into toykeepers files that can be found on launchpad.
Please correct me if i am wrong. There is the Anduril.c file (a “universal version”). With the .cfg file i change/turn on funktions for the specific driver. But where do i define the driver hardware?
In the config file i find a hint to a hwdef-xxx.h file. But can not find it. Can someone help me out a bit. Or if this was asked in the past and there is a post for it i would be thankfull for a link.
In the past i used ready hex files for flashing (and it is a long time ago). I can not code (only SPS and a bit of basic from 25years ago) but i can see that TK invested a lot of time to give us a very modular system.