Flashlight Firmware Repository

I finally merged FSM into trunk again today. It included several bug fixes and other updates since the last merge.

  • Added support for Fireflies lights.
  • Tweaked thermal settings for a few lights.
  • Fixed a bug with one very specific click sequence causing a MCU hang.
  • Fixed a bug where changing the ramp style could sometimes jump to the wrong brightness.
  • Added a moon timing hint on hold-from-off.
  • Fixed a timing inconsistency on hold-from-off; stepped ramp took too long to start ramping up.
  • Added manuals for RampingIOS V2 and V3.
  • Added a ramp shape parameter to level_calc.py.
  • Added initial support for a second set of aux LEDs, but it simply copies the behavior of the first set.
  • Fixed a bug where thermal regulation could go up from the requested level after double-click-from-off.

The only UI change people would likely notice from this update is the moon timing hint.

What firmware would you suggest to use with a 7135 driver and a momentary switch (SRK style light)? At the moment I have Attiny13A with STAR firmware. Does that kind of driver work with Attiny25/85 and Crescendo, Bistro or NarsilM?

Bistro and Crescendo use a switch which disconnects power, not an electronic switch like the SRK has. So those aren’t really options.

The attiny13 doesn’t have much capacity in ROM, so it can’t fit Narsil or Anduril. However, if you put an attiny85 on instead, it should work. Those can usually fit onto the same pads, but you might have to bend the legs under the chip to make it fit.

There are some other e-switch firmwares though, and some can run on attiny13. For example, the Ferrero Rocher set has three interfaces to choose from. They just don’t have a lot of features.

So if I change the Attiny13 with an Attiny85 and NarsilM it should work? I was not sure if NarsilM is suitable for a 7135 driver. That would be great because I really like the ramping and the different features on my Emisar D4.

Depending on the details of the driver, it may or may not work. There are a lot of different circuits which can be called “a 7135 driver”.

It is the 46mm SRK 32x 7135 driver from MTN Electronics. There is no FET but only 7135 transistors. Maybe I will try it with Attiny85. I should find out quickly if it works or not when turning on the flashlight.

Oh, I have one of those. I ran Ferrero_Rocher/Ramping_UI_table on it.

It was okay, but the ramp resolution at the bottom was very coarse, and it had no extra features except battcheck. Giving it an attiny85 would give it more features, but would not improve the ramp resolution. Also, you’ll probably have to compile a custom version of the code to make it work, because I don’t think there are existing recipes for any single-channel drivers.

It may also be desirable to remove the voltage divider resistors, to reduce standby current, after getting everything else working. The tiny85 code can get that info from a different pin, so the divider isn’t needed any more.

Maybe the Ferrero_Rocher/Ramping_UI_table would do for me. I rarely use the special modes and the ramping sounds good. So I can just reprogram the soldered Attiny13 and do not need to change it. Also it would be too much for my limited coding experience to compile custom codes. Many thanks for all your useful advice and flashlight firmware!

Is there a driver schematic repository? I’m sure all the old hands know what pins go to where and the values of the passives from memory. I don’t.

I’m working out the Convoy 3/5 mode driver. It looks similar to a Nanjg 105C. Schematic for the Nangj is

Vcc cap and PB2 voltage divider appear to be the same but with different values. PB1 (pin 6) is connected to the 7135s.

Pins 1,2 and 3 are n/c ?

I got out the magnifying glass. Same as Nanjg without the stars.

Looks like this:

Battery + goes to cathode of D1. Battery - connects to the tail switch.

Hi TK and all BLF friends.
I would like to use crescendo in my TA drivers, but I’m having some trouble.
If I include the thermal regulation in the compile, the resulting hex file became too large for the attiny 25, even setting optimize to size in the toolchain menu.
If I deactivate all the special modes like bike, strobe, beacon etc, or reduce the ramp size, than I can use thermal regulation, because the hex file size became smaller, but that is not a real solution.
Is it possible to use crescendo with the special modes and thermal regulation for the attiny 25?

I get 2008 bytes for the FET+1 build, and 2016 bytes for the 3-channel build, without changing anything else. It can be up to 2048 bytes before running out of room. I’d suggest trying the compiler settings in bin/build-25.sh to get it to compile to the expected size.

TK thanks for the reply.
Later tonight I’ll try the build-25.sh and post here the results.

TK, could you please explain how to use the build-25.sh on a AVRStudio project?
I already downloaded the build-25.sh from your repository.

Nope, I can’t really do that. I’ve never used AVR Studio. About all I can say is that you’ll have to find the places in the GUI where all those compiler options are hidden… but I don’t know where to look.

Sorry, there is no driver schematic repository. I don’t even know how the concept of open-source would apply to something like that.

TK, what software do you use to compile instead AVR Studio?

Instead of AVR Studio, I use the tools and commands listed in the bin/build*.sh scripts.

AVR Studio uses the same tools to compile things, but it adds a bunch of extra layers around that to wrap it in a GUI. I don’t have any computers which are compatible with AVR Studio though, and don’t much care for GUI development environments, so I take a more direct route.

It’s all pretty easy to do under Linux, or in a Debian-like OS. This includes Windows 10, using its ability to run Ubuntu in a sandbox. Just a few commands to install the relevant packages, and then things mostly just work.

Most of the time, I just hit Up, then Enter. Or Up, Up, Enter. And things get compiled, or flashed, or whatever else it was I was doing.

TK, that’s way out my capabilities.
If I manage to make AVR Studio to compile crescendo with the thermal management included I’ll post here.
Thanks again.

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