Flashlight Firmware Repository

Oh, um, that sounds like you’re doing a long-press or full click instead of a short press. All long-presses go back to the initial state, so it needs a short-press to enter thermal calibration mode.

Thanks for the answer TK, I was making a full click so it wasn’t working :person_facepalming:
Great UI this Crescendo! I would have some suggestions but they may have been mentioned before!
Thanks again :wink:

This is the wrong thread but hoping someone can point me in the right direction.
I was reading somewhere that I can no longer find about Narsil M being run on the BLF A6 driver.
I have programed the Atiny 85 MCU and installed it on the driver. From memory the switch was run of pin 2 and earth. From what I can gather pin 2 is the second bottom from the left pin.
I can only get a flashy mode and a low mode with this setup.
Where have I gone wrong?

I’m not totally sure, but I think you can probably remove the OTC and use its pads for the switch wires. You may also be able to remove the voltage divider resistors to reduce standby power, and have the attiny use VCC to measure voltage instead.

Otherwise I think it should work, assuming you use the FET+1 build with VCC measurement instead of pin7.

The layouts I see are…

BLF-A6:

 *           ---
 *         -|   |- VCC
 *     OTC -|   |- Voltage ADC
 *  Star 3 -|   |- PWM (FET)
 *     GND -|   |- PWM (1x7135)
 *           ---

NarsilM 2-channel:

 *              ---
 *   Reset  1 -|   |- 8  VCC
 *  switch  2 -|   |- 7  Voltage ADC
 * Ind.LED  3 -|   |- 6  FET PWM
 *     GND  4 -|   |- 5  7135 PWM
 *              ---

Oh, er, there may also be an issue with voltage spikes when the FET is active. I’m not sure. That was an issue on older BLF-A6 / BLF-X6v2 drivers. IIRC the solution was to add a tiny resistor to take the edge off each FET pulse.

I got here a new driver development which works from hardwareside on Bistro and NarsilM wit a P-FET to use Oslon Black flats on DTP stars

But two things for NarsilM needs to be changed

first
all the blinks do not get to the LED as I use MCU Pin 6 over the ramping table to activate the inverter enable chip to keep the parasitic drain low
so adding Pin6 to high permenently as soon as the MCU gets active or adding it to the blink code

second lower the blink brightness as its shown by the MOSFET

I use the 3 channel with modified ramping table so far its workin, but all blinks keep silent as the inverter is shut down

Astrolux S1 BLF A6 A17DD-L FET+1 and BLF X6 X5/Astrolux S2 S3 SS SC with attiny85 Transplant is the thread by Moderater.I’ve ordrered an A6 driver to try out.

Thanks TK. I’ll post a picture up when I get time to get some pointers on whats what.

I Did Not Finish,my link was for you.

Thanks Billy. I knew it was here somewhere. :+1:

You’re welcome.

Hi, I’m not really familiar with what you’re doing, and I don’t think I understand what you’re asking. Care to elaborate?

I guess the easiest fix would be to move the FET pin for 1 channel version moved to pin 3 Indicator to pin 7
I am totally puzzled looking in the channels file how it works

I have the FET output as in 3 channel, P-FET is one channel only so low blinks should do on the FET channel

Calibration files can be generated by following the instructions in battcheck/README. It’s meant to be relatively easy to calibrate any hardware, and relatively easy to plug into each code project, since calibration varies quite a bit from one driver to the next.

I’m not really doing any hardware design yet, so I can’t really make a driver for tiny841. It does look like a nice upgrade though, and I’ll probably port code to such a thing as soon as I have hardware to use for development.

Toykeeper, thanks for the work you do in maintaining the flashlight firmware repository. I successfully flashed the AK-47 driver in a red XP-E2 Convoy S2+ I built as a bike light using the firmware you developed in this thread, and I also updated my BLF Q8 to Anduril.

Now down the rabbit hole of customizing firmware code, since apparently hardware mods aren’t enough :slight_smile:

It’s a deep rabbit hole.

Hi guys
I wanted to change the modes in my astrolux s41 (blf a6 firmware), but I can’t understand this speed pwm. Could anyone write to me how it should look corrrect in my modes? (Blue)

Green. Can I set the brightness of these modes there?

Fast is about 15 kHz, but doesn’t work well for moon and turbo and anything which needs to ever shut off the LED completely. Phase-correct behaves better, but is only ~8 kHz.

The numbers below, starting at 255 and counting down, are not the brightness. They are simply internal codes to represent each special mode. To change the brightness you’ll need to edit other parts of the code. Some of it can be changed with the BLINK_BRIGHTNESS setting, but turbo and strobe are hardcoded to full output and you’ll need to change the code directly.

I think I understand. So it’s ok.
Unfortunately, I have another problem. The medium press doesn’t work properly. It should be 0.5s to 1.5s, and I have about 3 to 6 seconds. The original firmware worked correctly.

this is a common problem
physically reducing the OTC from 1uF to 0.33uF should fix it

no clue where in the code the OTC voltage is interpreted and how to adjust it

Leviatan, look in the battcheck/ directory. A “README” there explains how to calibrate the voltage and OTC. It involves doing some measurements then editing a calibration header file (“tk-calibration.h”).

The OTC is pretty sensitive to slight differences in hardware, so it’s a good idea to calibrate each batch of drivers. Even just changing the supplier of a single component can throw it off.