Ready to go FW for Attiny13A

I am just now getting into flashing my own firmware. I am totally in over my head at the moment, and am wishing for some guidance. I having been going through some of the FWs in ToyKeeper’s firmware repository, and have flashed and tried a few of them. I have not been having very good luck, as I think I’m beginning to realize that most of these firmwares require an OTC which I do not have. Also with some of the firmwares I have tried that mostly work, the moon mode normally does not turn on.

I realize I don’t know what I’m doing, but I wish there was a guide or something more progressive that would help me learn. I can hook up my clip to the Attiny, type in a few lines of command line magic and flash the chip, reflow it, and power it back on, but if this means learning all the syntax and everything I may have struck out.

I’m basically wishing I could find a 4 or 5 mode firmware with memory and LVP that works with the Qlites.

I tried the A6 but it didn’t even light up, wish I could get that one to work. I also don’t know firmwares are ready to be flashed to a regular qlite in .hex format.

I’m excited to begin the software side of flashlights, but sort of unsure where to begin or what will work out of the box. Is there a place for other firmwares for me to try?

Are you using windows?

Unfortunately, yes.

There are definitely firmwares that do not require an OTC. Star for one. But I don’t know if there are precompiled (ready to flash .hex) non-OTC firmwares in ToyKeepers repository.

And you want to avoid compiling at this point, correct?
I don’t recall how to do it on windows anyway. :laughing: Just linux.

Do you recall which firmwares you’ve tried?
Moon mode, sometimes the default setting in a firmware will be too low to get the led to light up with your particular 7135 chips. Some 7135 chips will work with a low value, others won’t.

Do you want any extra modes (flashies)? TheStar has a some hidden modes. .hex available.
Or if you only want 4 or 5 normal modes, memory and LVP, maybe DrJones’ nlite ? .hex

I should clarify. I don’t mind compiling firmwares from a .c file, I have done so, and I think I got at least one to work. I have messed around a bit in the Atmel studio. I remember trying the Star firmware and IIRC about half the modes worked. That’s the thing- some of these sort of work but not all the way, even if the flash was 100% successful.

I should try Star again, just wish I knew what it took to get it to work 100%.

I believe the Qlites I’ve been using have the higher binned 7135s, the 380 mA version.

I’m not familiar with the qlite but “about half the modes worked” sounds like perhaps you’re trying dual PWM firmware (meant for a FET+1 driver) on a driver with only channel. So the modes which use the second channel don’t produce any light (either the low modes or the high modes depending on which pin is used).

It would help if you could point to the exact firmware you compiled and any alterations you might have made to the modes list.

Thanks. That makes total sense, as I saw in the Readme of a few of the codes that it said dual PWM. I didn’t connect the dots that it meant it was for FET+1 drivers.

I don’t remember which firmwares anymore, seems like I’ve tried about all of them, and I haven’t messed with any of the code yet.

If that's the problem, fixing it is fairly easy. Just change the mode values to be the same for both channels. For example, in blf-a6.c, you could use something like:

#define MODESNx1            2,10,20,50,90,160,255
#define MODES1x1            2,10,20,50,90,160,255

#define MODESNx2 20,60,130,255
#define MODES1x2 20,60,130,255

Edit: By the way, dual pwm doesn't have to mean FET+1. Some drivers might have a channel with one 7135 and another with several.

For something to practice with, that doesn't require any non-Nanjg hardware changes, use DrJones' luxdrv. It should build and flash and run on a standard 105C with no changes, just to verify all the links of the chain are working.

Once you have a FW you have altered and want to keep, make a .bat file (just a plain .txt file but with a .bat extension) containing the avrdude commands. You can copy/paste, just changing the filename to point to the correct hex file as needed. Make a .bat file for each compiled hex. Then, to flash a new driver with that version, you just connect the clip and double click the .bat file. Done.

Compiling luxdrv isn’t working. I’m trying the 0.30 version, and I’m getting two errors:

Severity Code Description Project File Line
Error recipe for target ‘main.o’ failed GccApplication9 c:\users\kelsey\Documents\Atmel Studio\7.0\GccApplication9\GccApplication9\Debug\Makefile 79

Severity Code Description Project File Line
Error variable ‘modes’ must be const in order to be put into read-only section by means of ‘attribute((progmem))’ GccApplication9 c:\users\kelsey\Documents\Atmel Studio\7.0\GccApplication9\GccApplication9\main.c 51

Can you tell me what I’m doing wrong?

Line 48, up near the top. Line that says

PROGMEM byte modes[]={ MODES };

change it to

const PROGMEM byte modes[]={ MODES };

Back when luxdrv was written, it worked with the then-current version of Atmel Studio. Atmel changed something in later versions that doesn't like older code.

if you want to play a bit with modes and blinkies on a nangj driver you can do www.flashmylight.com you get the hex file ready to flash on your driver

Hey comfychair, thanks for that code change. That let me compile my firmware just fine and am now running luxdrv!

So much to learn in this vein.