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

Flashing the original hex file won’t work - those are compiled for a specific chip. At minimum, you’d need to recompile. Though with the ’84 you’ll probably need to make sure you’ve got the correct pins defined and such. Minor changes though.

You have to use -c stk500v1

Flash newbie here — is buying a driver from FastTech with “Nanjg 105c” in the name still the best path to success for flashing custom firmware?

https://www.fasttech.com/category/1612/diy-kits-parts-led-drivers?sort=r&keywords=Nanjg+105c

They don’t seem to be available in the 3 * 7135 driver configuration which I wanted for a safer light for a kid (i.e. no lighting things on fire even if I screw up the firmware).

Would any of these work:

https://www.fasttech.com/category/1612/diy-kits-parts-led-drivers?sort=r&keywords=1050ma+AMC7135

Or would I be better off getting a 5 * 7135 Nanj 105c and pulling off a couple 7135?

Side question, wth does “Nanj 105c” mean anyway? Thanks!

The Nanj 105c is a good driver and probably the simplest to work with. Some of the off brands I have seen in the past were mcu locked. I dont know if thats still true but I would order the Nanj to be safe. Buying attiny13a’s and replacing the mcu would fix the locked issue if need be. I would just buy the 8 amc735 driver and take off what ever is needed to achieve the current I wanted, then I would have spare amc7135’s. The 4 amc7135 board was single sided if you had rather have that (Nanjg 101).
.
BLF has migrated to more of the FET+1 drivers now or a varrent. Lots of firmwares for these drivers if you get the ones with a attiny85.
The BLF crew is starting to branch out to a lot of other type drivers now, buck and boost, or both. Its a exiting moment seeing all this happen.
They are using more advanced MCU’s that are better and have lots of new features so the firmaware can have new better features.
.
As far as I know the drivers at Simons store on Aliexpress work for reprogramming. https://www.aliexpress.com/item/1012980984.html

Thanks for the reply — while I like your idea of removing 7135 chips and having spares, I have less faith in my micro soldering skills. I’m sure I can get them off but it might not be pretty. :slight_smile: And I would prefer the cleaner layout of the single-sided board.

So the 4*7135 Nanjg 101-AK-A1 is ok, would the 3*7135 Nanjg AK-47A also be ok, it just needs to be a Nang board?

From what I gather Nanjg is the manufacturer of the board (not any of the components), is that correct? What do the other numbers refer to?

First time success flashing the green 3/5 mode convoy driver to Biscotti (after I followed advice of gchart for cutting the trace) :+1: :+1: I recommend the Pomona clip, it’s so much better than the cheap ebay one.

I pulled a red biscotti convoy driver out of a C8+ from Banggood because it’s buggy firmware. Flashing was successful but it’s still buggy. Is there another procedure that I need to do?

Either one should work. The mcu doesn’t know how many amc7135’s your using, there all wired parallel.
I forgot to mention that Mtnelectronics in the states has these as well for faster shipping.
http://www.mtnelectronics.com/index.php?route=product/product&product_id=240
I have no idea what all the naming and numbers is about with these drivers.

I successfully installed the driver.
I assume the AVR tools are no longer needed. Correct?
https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers

I’m planning to buy a Convoy S2+ and/or S21A, and want to define my own mode group.
Is that possible?
I can’t locate the thread, but today I’ve read that some PCBs are glued into the flashlight and some not. It was an old thread IIRC. Is that still the case?
This is my first attempt at programming a flashlight, so I want to start out as simple as possible.

Convoy started to use many non-ATtiny drivers. Some are soldered to the pill, some have a retaining ring, some might be glued. Do you have everything else? ISP programmer, SOIC clip, source code? Some drivers are “locked” by pulling a pin high and you have to cut the trace.

I can’t help you with Windows, only Linux. Biscotti can be found in ToyKeeper’s repo (just google for ToyKeeper and flashlight-firmware).

AFAIK I have everything I need. I Both the software and hardware listed in the OP.
The only thing missing now are the flashlights.

As said above - about adding your own mode group, all depends on the driver, whether it's re-programmable with one of our versions of firmware or not.

This driver made it possible to flash with my new computer. I wasted many hours installing the same two drivers with Zadig, updating device drivers as well as uninstalling and reinstalling avrdude and the usbasp. Originally I could connect to my gxb172 driver a couple times in a row then nothing, rebooting the computer didn’t help. Then the next day it would work for a bit and flake out again. Then it stopped working all together, tried a different usbasp but no luck. Usb2 or usb3 port made no difference.
It wouldn’t ever talk to an 85 or 25.

I can now program a bare 25 if the jumper is set to five volts. I can program the gxb172 directly from arduino at both voltages, the baud rate is very slow so maybe the 25 can be programmed at 3.3 volts if I slow avrdude down. My old computer and the new computer are both windows ten. Flashing used to be so simple, not sure what’s so different about the new computer.

Next step is to order two new usbasp’s and do the firmware updates to get rid of the set sck error. Then get atmel studio working.
Might even try getting the usbasp working inside atmel studio. Looks pretty straightforward in this video. https://www.youtube.com/watch?v=kPcgjkQn2eE

Hey wizards. I would like to upload biscotti to the red Convoy driver and to 105C, but with 20 clicks to the settings. Unfortunately, when I change the value from 9 to 19 in this line:

 if (fast_presses > 9) { // Config mode

the LED lights up (or not) in the low mode and does not respond to clicks.

I tried different amounts of clicks and 14 clicks (value 13) is max.

Does this setting need major changes? Why can't it be easily changed?

Maybe it’s related to:

            // We don't care what the fast_presses value is as long as it's over 15
            fast_presses = (fast_presses+1) & 0x1f;

?
Remove that

& 0x1f

and try again.

You should have a line above that a little ways that looks something like this:

fast_presses = (fast_presses+1) & 0x1f;

What value is at the end? Is it 0x1f or something else? With 0x1f is should track fast_presses up to 31 or so.

Edit: it looks like Agro and I were typing at the same time! And yes, you could try his suggestion. Having something on the end there just makes sure it doesn’t overflow. But you’d have to do a lot of fast presses to worry about that.

Yes, there is 0x1f and removing that helped.

            // We don't care what the fast_presses value is as long as it's over 15
            fast_presses = (fast_presses+1) & 0x1f;

I noticed these lines and thought the maximum 14 clicks might have something to do with it and tried to change the value (don’t know what I was doing :smiley: ) but didn’t think to delete it.

Thanks guys!

Ohhh… changing that to just anything could most definitely have some strange effects. The thing with “0x1f” is that it’s 00011111 in binary, and since we’re doing a bitwise AND operator, it forces wrap-around to 0 once it hits 32. But choosing another value would cause some bad behavior. Say if you changed it to “0x20”, that’s 00100000 in binary. And basically you’d never get fast_presses to increment because bitwise AND on all of those 0’s is going to leave you with fast_presses = 0.

What exactly is the 40-pin Splittable Ribbon Cable required for? Seems that the chip has 8, but the clip only connects to 6. So why 40?

And speaking of the clip, the Pomona 5250 SOIC (SOIC8??) clip, it looks like a deal breaker. 80 to 100 CAD with shipping for the thing on Amazon, or eBay for it is insane.

I may have found other 8 pin clips, included with other programmers, but they are 20-40 $, trial and error could be as much as the Pomona 5250.

Why is it that there appears to be complete programmer/connector/clip solutions for other chips, but none I’ve found for the Attiny chips?

I’d pay a reasonable price if there were one, $35-40, but while I have yet to search AliExpress, so far, I cannot seem to find a single source at a non rapey price. Between the various propitiatory bits needed for radios, complex high powered motor controllers, crypto key loaders, and other stuff, I already have a ponderous collection of USB and serial programming cables, like some post-Dickens iteration of Jacob Marley. And I find it more than just a little irksome that there does not seem to be any commonality for firmware connectors.

How difficult could it be? The whole chip-clip-trip seems like a very inelegant solution. A nano DIN, with a no-go if misaligned pattern, preferably with solder ringed female board holes for the pins to connect with, perhaps 5mm in diameter would do nicely. Preferably one that locks in place, requiring pressure on the connector to release.

Thus endeth the rant. Now, off to Aliexpress land.

Not sure what you mean. I paid $5 total for the clip and the usbasp. I hope your connector rant is a joke. This board was not intended for modding and a suitable connector costs more than 10 of these boards and there’s no space left anyway.

I’m pretty sure the 40 pin cable is suggested because it’s an industry standard, very cheap and easy to find. If you run across a lesser number pin cable with all the same features then feel free to get it. No big deal.