Flashlight Firmware Repository

I'm keeping the e-switch on pin #2 for now. I'm working on indicator LED support on pin #3 (locator and low voltage indicator).

Why not just use 1 pin to control 2 colors? A high on the pin will trigger 1 side of an LED and a low can trigger the other side of the same dual color led. I have not looked into the amount of current this chip can source and sink, but 30 ma should be enough. I have not tried this with the tiny13 but have done it on the Pi and Arduino several times.

Matt

Well, that’s one kind of dual-switch arrangement. I thought people would just use brown out for click sensing. My main worry is that she will make this great firmware that won’t work with most of the driver pcb’s we have. Then if we make pcb’s for that firmware, we won’t be able to use Pin3 for other things, like indicator led’s or extra outputs (TripleDown)

I have a couple of dual-switch lights sitting around that are just empty shells because I don’t have a firmware I like for them. Like was posted a little earlier today, I would be very excited if we could add dual-pwm support to star-dual-switch or added memory support to Star-momentary. I’d literally freak out and jump up and down if that happened and if it could work with the extra output for my TripleDown board like DEL helped with on blf-a6 a couple weeks ago.

I’ve mentioned it before, but there doesn’t seem to be a lot of interest, so I silently keep working on my boards and firmware :slight_smile:

That’s what I had in mind, sort of, I guess.

I found a nice explanation of how it could work that even a dumb dumb like me could understand. I thought maybe someone could make something useful out of it, that’s why I asked…

@Mike C, the things you do are both very impressing and over my head at the same time. Looks genius from my point of view! I’m sure it looks genius not only from my dumb-dumb point of view… :slight_smile:

Well, that… and I’m hoping to be able to use one dev board for both clicky firmwares and e-switch firmwares, and for both single-channel and dual-channel firmwares. It’s nice having a few bits of versatile hardware instead of a lot of single-purpose pieces. I’ve got a growing pile of decapitated light heads with drivers hanging out on long wires.

It doesn’t have to require OTC for a dual-switch project.

RMM’s FET+1 SRK board looks really nice, but I don’t know if he still sells it. My SRK might make a decent all-in-one dev host, and it’s not really getting used for anything else now that there’s a Meteor…

I’m interested! :slight_smile:

Even without the hardware, the code would be a great source of ideas and reference material. Like the 3-way-overloaded pin. That’s brilliant!

I’m a big fan of release early, release often.

I assume it would be pretty difficult to add the battery monitoring code from Ferrero Rocher into a clicky firmware like star-offtime?

Realtime battery status on a clicky shouldn’t be terribly difficult. Of course, it can’t display anything while it’s off. :slight_smile:

Details aren’t worked out, of course. And it’s hard to add more to STAR because it doesn’t leave a lot of extra room… but after removing things we don’t need any more (like solderable star support), there’s enough room to add other stuff.

Well I have a special use in mind. The driver will (almost) always be powered, but quick interrupts will be used to change modes.

I swear I knew you’d come up with something like this when I read your post #742. Must be a special kind of tailcap board again or some sort of on-on-clicky?

hey,

I’d appreciate some help. I played around with bistro, wanted to make a single channel version for a p60-drop-in with 105C-based-driver, that’s working so far. I know it’s also quite easy to make a 2-channel-driver out of a 105C by rearranging the traces a bit, that’s easier in fact. But with this Nichia I wanted to prioritize best as possible tint over efficiency, and a smooth as possible ramp. And that’s where my lack of knowledge comes to play. If I were to increase RAMP_SIZE to 128, would that cause any trouble? I tried to adjust both attiny.h and bistro; https://www.diffchecker.com/ow8bdznq; https://www.diffchecker.com/7rr33hvf. But that doesn’t seem to work right… What am I doing wrong?

To increase the ramp size, you’ll need to turn off something else to make room. The ramp itself can be calculated by level_calc.py. I’m not sure right now how hard it’d be to disable dual PWM entirely, but if there’s room you can always just leave the second channel at all zeroes.

I’m on a phone at the moment, so I can’t really do much with the code…

Thanks Tk!

Ramp was calculated with level_calc.py, 128 modes, I think I got dual PWM disabled completely, compiles (2022 bytes, 98,7 % Full, with AS6.2) and flashes fine. All modes ramp up, but Turbo gives two short flashes, little pause, than 100% const. Also the ramp with the modes that work correct doesn’t seem as smooth as the ramp of my X6 with dual channel driver and bistro with 64 mode-ramp.

The bottom end of the ramp will be less smooth with more 7135 chips on a single channel. The steps are bigger, and in the lowest modes those steps are pretty visible. Notice how it has a bunch of the same number at the beginning, then at the end there are 5 PWM levels between steps? A bigger ramp can’t increase the physical resolution of the hardware.

As for the highest mode blinking, I suspect that might be because the soft start uses a signed 8-bit integer to determine how far to ramp (and which direction), and your path from zero to full is one step too long for a signed 8-bit int. Perhaps try with 127 or fewer ramp steps?

hmm, now that you say it, it makes things very clear. Yery well explained, thanks. Maybe I should give a dual channel 105C a try.

I went down to 100 ramp steps, now it works when going through the modes normally, but reversing from moon to turbo still gives weird flickering. Since I have only forward clickies in my P60 hosts (that has to change) I will be ditching offtim3 anyways, however I still would like to find out what causes it.

I’ll have something shortly and will make my own driver thread. The code itself is not much different to current voltage reading code. It’s just run much more often.
Disclaimer: More often than Star. I haven’t looked into any other firmware than my own for quite some time.

Dear ToyKeeper,

I am building a 7.2V light which will be flashed the Baton firmware. Would you please educate me that the ADC_0, ADC_25, …. ADC_100 are used for.

Am I going the right way to modified the codes like this. The R1 is directly connected to B+, no diode in between.


Those values are used to control the realtime battery indicator lights, and to decide when low-voltage protection should start.

Rather than calculating with a formula, I find it more reliable to measure. You can do this by using the battcheck.hex firmware. Basically measure a full battery and a near-empty one, then use the battcheck.py script to calculate the values at each voltage, then plug those into the actual firmware you want to run.

Many thanks for your prompt reply.

I have omitted to read the README enclosed in the battcheck folder. I will try the battcheck firmware.

Thanks again, your Baton firmware is working great.