Flashlight Firmware Repository

it is user-configurable. It can be set to be toggled by soldering a star, or by a soft-toggle (the same way you change mode groups). By default, it starts out no-memory.

I’m in need of help for a new-ish UI (unless somebody already has one that would work.) It is for an LEO, he wants a dual-switch light (traditional click-switch + e-switch). I just don’t know where to start. Is STAR dual-switch the best jumping point?

  • Main power button is only on/off
  • e-switch changes modes
  • single click to cycle L>M>H
  • 0.75sec hold to access fast strobe
  • single click from strobe to access slow beacon
  • 0.75sec hold to return to main loop
  • Mode memory for all modes
  • LVP protection

If you’re only using single pwm output you can use a firmware I wrote a while back. It’s very easy to use and only got pre set values.

If you don’t touch anything outside of Start/End user tweaking I don’t think you can mess up this one.

Ahhhh I’m also not using the latest version. I’ll update my firmware.

Yes, and by default you can toggle mode memory by entering config mode then turning it off between the second two blinks. Here’s a visual summary of the default interface:

STAR dual-switch is probably the best starting point. I haven’t attempted to make a dual-switch firmware, and I’m not aware of many which already exist. However, you’ll probably need to change a fair amount of the code to get the features you described.

If you don’t mind it resetting to the first mode each time, any e-switch firmware can be used on a dual-switch light. However, I doubt that’s desirable for what you described.

At first, I thought LEO meant “low earth orbit”. :slight_smile:

It shouldn’t be too difficult to add “memory” to an e-switch firmware, should it?

I think the memory parts should be relatively easy; mostly just copy and paste some code from other projects. It’s the UI changes which pose more of a challenge. E-switches need considerably more UI code than clicky switches.

If I skip the Beacon part it should be easy. Just start with STAR Momentary, add the memory bit, and change long press to mean strobe instead of reverse mode

ToyKeeper wrote:

ImA4Wheelr wrote:

Thank you ToyKeeper for hosting these shared FW’s.

I haven’t been keeping up with this area. Is there a place that has the UI’s and operating perimeters of the various FW’s and variations?


The closest thing is the repository index file, which is mostly intended for searching, not so much for reading. Beyond that, once you’ve found something compatible with your switch type and driver type, it’s mostly a matter of reading the text files included with the matching projects to figure out which ones sound best.

Thank you for that info. :)

Hey all,

Is there any way to program the generic micros that look the same as the Atiny13A? I have seen these on some drivers before, but not ever tried to program one.

A generic SOIC8 chip could be anything. Attiny13 is only one of many chips which look like that, and each one works differently. The details probably vary for each type of chip.

I’ve updated my firmware and selected;

Which should give me mode memory? Correct? But I still don’t seem to have it. I’m using a zener modded board could this be affecting it?

Also when I start again it gives me my lowest mode. Even in the second group it gives me my lowest of the first. It starts with the lowest of second group then after a second goes to lowest of first group then I can cycle through the modes on the second group like normal.

No, that only controls how that option gets configured. With CONFIG_STARS defined, you can enable mode memory by grounding pin 3. With it not defined, you can enable mode memory by pressing the switch a bunch of times and then turning it off between the second set of two blinks. Neither method turns it on by default.

If you want mode memory hardcoded as on, you’ll need to change some other part of the sources, or use tk-otc.c (which drops the config mode entirely in favor of hard-coding options, but provides more space to add features).

Yesterday I flashed my first driver (stacked 105C, 12x7135) with the S7 firmware, worked fine, very nice firmware. I used the ready to use .hex-file.

Today I wanted to try star_noinit. Therefore I had to create a hex file. I have to say I’m a total newbie to all of this flashing/coding stuff.

I have Atmel Studio 6.2 installed. Finally I’ve been able to get a hex file, but it’s 2685 bytes.

The way I did it was: file~~new>project-> GCC C ExecutableATtiny13A, then deleted that automatically created stuff, copied and pasted in the code,>projectproperties>toolchainOptimization(under AVR/GNU C Compiler)~~>optimize for size (Os), then build>build solution

I just installed AS6.2 without making any changes to whatever settings.

Help would be appreciated. Thanks.

The hex file size isn’t so important; it’s the size of what the hex file represents.

I have .hex files at 2893 bytes which still fit. When I run avr-size on it, it tells me how big the file actually is, and that limit can go up to 1024 bytes. I’m not sure where to get the avr-size data in Atmel Studio though.

Thank you very much, Toykeeper.

The pictures are broken but I think you get the idea. Way back when I started programming these 13a's these instructions worked for me on 6.x.

Hey TK (or anyone else)

In blf-a6, how do I get the tactical strobe into the main loop? I see it is given 253 as a convenience code, but I can’t see anywhere that it’s actually used?

Can I just transplant the code I’ve used in STAR_OT?

//mode_idx254 is the Strobe Mode
if (modes[mode_idx]254) {
while (1) {
PWM_LVL = 255;
_delay_ms(50);
PWM_LVL=0;
_delay_ms(175);

Edit: Just gave it a try, all it takes is to put the convenience code into the normal mode order. easy as pie. Now i feel silly for flapping my lips before switching on my iron. :zipper_mouth_face:

Hi TK,

I decided to take your advice about using the FET + 7135 driver to get the super low mode I want with an XHP setup ( parts are on the way)

What I am wandering now is will I be able to tweak the Star_off_time code to get what I want out of that?

I see that there is a line of code there to enable a second PWM ( line 86)

//#define DUAL_PWM_START 8 // Above what output level should we switch from the alternate PWM output to both PWM outputs?

What else would I need to do to get this rolling with the dual?