Flashlight Firmware Repository

You don’t need software programming skills to change mode levels. All you need to do is change a few numbers. Star is basically written for easily defining modes, mode direction, memory, timeouts etc etc… It’s pretty easy to grasp.

Is there any idea of what the "OFF" current of momentary firmware can be? Any ideas whether the current is in the few microamp range? Or are we talking tens or hundreds. Do any of the mom. firmwares go to sleep mode when "OFF"? Would using the reset pin PB5 for the switch input allow for deep sleep? (It would probably remove the possibility of short/long press detection.)

I'd like to run from a single AAA cell where capacity is quite limited.

From what I recall, I measured the “off” current on Ferrero_Rocher to be about 0.36mA with the green indicator LED on (dimmed), or about 0.33mA with the indicator off. About 1.23mA with the indicator on full. So, anywhere from ~10 to ~45 days of standby time on a 10440 cell.

But that’s without seriously optimizing for standby power; IIRC it can get significantly lower with the right code. Atmel published the specs but I don’t recall the actual numbers.

What I want to know is how you fit an e-switch into a 1xAAA light.

This is very good!

Thanks!!

Oops LOL I didn't mean an e-switch AAA, like an EDC, that would be tricky (but possible). I was thinking of retrofitting a headlight driver as it already has the e-switch. What I'd like to design for is say 80% remaining capacity after 30days of standby. (or 90 days better yet) If you use all the capacity in standby time then its no good.

The tiny13a draws 2uA in power-down, but requires a reset or power cycle to recover (correct me if I'm wrong). That's why I wondered about using the reset pin for the e-switch input. I'd also need some way of disconnecting the ADC resistors to eliminate their current.

If I only had more time ...

Noob question. Would starry-offtime work on a standard Nanjg 105c? I'm thinking I need to make the following changes:

and/or zero out "#define MODES1x" so it reads

Am I at least in the ballpark? Thanks in advance.

A standard nanjg has no offtime capacitor (OTC) so starry-offtime wouldn’t work on it. However, basic STAR and STAR_noinit should work, and so should anything listed under “mem decay” or “ontime” in the INDEX file (as long as it’s also listed under attiny13a).

You should also make sure that the switch type matches — clicky or momentary. I’m guessing you have a clicky.

Sorry, I meant Nanjg 105c with an otc installed. I was just hoping to use some of the advanced features of starry-offtime but was unsure about the secondary channel bits. I'm currently running STAR offtime on the driver in question.

Ah, okay. It should work then. But if it has only one power channel, you’ll want to use only the primary PWM (MODESNx, not MODES1x, and swapping the fast/phase defines like you already did).

You might also get more mileage out of the blf-a6.c or tk-otc.c firmware, which are similar to starry-offtime but more mature. But you’ll need to adjust the ADC values for offtime and voltage (which can be measured with the firmwares in battcheck/* or copied from reference values).

It also currently requires changing a line of code in the battery check mode, but I’ve been meaning to fix that for easier use on single-channel drivers.

I appreciate it! I'll give the blf-a6 and tk-otc firmwares a shot. I presume I shouldn't try to use the battcheck mode on either firmware with a single-channel driver for the time being. (I'd change it myself if I had a clue what's going on... but I don't. )

Oh, it’s a simple change. Look for the “void blink” function and change its set_output(0,20) to set_output(20,0). This moves it from the second power channel to the first; otherwise it won’t light up at all.

But I have a few other improvements to make too…

I know it’s written in here somewhere, in several threads I guess… Anyway, when is phase correct PWM preferred over fast PWM? If I understand correctly, phase correct can produce some noise. But as the possibility to select it exists in a lot of firmwares there has to be a situation where it is beneficial. What would that situation be?

Phase mode is helpful to get moon modes between what fast mode provides. It also is required to make the emitters shut off completely in some cases on e-switch lights, because fast PWM still emits even at level 0 on some drivers. It is also less sensitive to low batteries, so the low modes won’t sag as much. And some people just prefer it, despite the whine and slower flashes.

Thanks for the explanation, I’ll test it someday. It makes sense except for one part. If one wants to shut off the emitter completely, why not just turn off the pin?

It would probably work, but it’s usually easier to just set PWM=0. Fast PWM will still output a brief spike even at zero though. IIRC, someone also tested a slight difference with PWM=255, where phase was slightly brighter than fast (fast has a brief downspike even at 255, I think). So as a general default, it’s usually a good idea to use phase at moon and turbo but use fast for everything else.

Adding pin logic is untested, I think, and would use a bit more room in an already-cramped space. It’s also redundant if there is already logic to put the MCU into sleep mode while “off”.

I suppose it’s a minor issue at worst, so nobody has spent much time on it.

To turn off the pin only one additional row of code is needed, but I guess your right with it being not needed. Thanks for taking the time to explain it.

Guys, Is there 1 mode-100% ( or star choosable 1 mode) 105c firmware awailable guys? Currently i am bypassing the atttiny13 in order to achieve this , and ofc warnings and cut-offf are lost this way

Hi Mitko,

I have a couple of “1 mode” firmwares you may like;

  • 100% only, with Low Voltage Protection enabled (will flash 3 times & drop down to 30 (out of 255) output when 3.2v is reached).
  • 100% Turbo for 2 mins, then steps down to 110 (out of 255). Retains LVP as per above.

These are for Clicky switches.

I can throw them into Pastebin, or email them to you if you like.

Isn’t 3.2v too high?
Can you send me these files too?

When using a zener modded board for use with an MT-G2 do we need to just adjust the ADC values or swap out the resistors as well to get it into a specific range?