NarsilM - configurable e-switch firmware for Multi channels, v1.3

I’m only guessing, but it sounds like maybe it’s doing what it’s supposed to do. Maybe the driver needs a way to bleed off power faster while power is disconnected, so it can measure shorter durations of offtime.

Or if the tail button is supposed to act as a momentary switch, maybe it’d be better to leave offtime disabled?

To do a UI where the tail is momentary and the side switch changes modes, it probably wouldn’t take much time. Click to go one level brighter, hold to go dimmer?

yes I removed some code lines that disable the lock already, but the Mode memory I do not understand at all

Since it’s a thing people might want, and since I think Lexel may have been requesting it, I took a moment to make a Werner-style momentary UI, side e-switch plus tail clicky-switch.

https://code.launchpad.net/~toykeeper/flashlight-firmware/fsm

The short version is:

While completely off (power disconnected):

  • Click tail to turn on at memorized level.
  • Hold e-switch and click tail to enter utility mode.

While on (regular “on” mode):

  • Click tail switch to turn off.
  • Click side switch to go brighter.
  • Hold side switch to go dimmer.

In utility mode:

  • Click side switch to go to regular “on” mode.
  • Hold side switch to go turn on at lowest level.
  • Double click side switch to turn on at highest level.
  • 3 clicks: Battcheck.
  • 4 clicks: Ramp config.

Battcheck mode: Blinks out battery voltage.

  • Click to go back to utility mode.
  • 2 clicks for tempcheck mode.

Tempcheck mode: Blinks out current temperature in C.

  • Click to go back to utility mode.
  • 2 clicks for battcheck mode.
  • 4 clicks for thermal config mode.

Thermal config:

  • During first “buzz”, click N times to set floor level to N out of 150 total levels.
  • During second “buzz”, click N times to set ceiling level to 151 minus N.
  • During third “buzz”, click N times to set number of total brightness steps.
  • Each “buzz” can be skipped to leave the value as-is.

Ramp config:

  • During first “buzz”, click N times to calibrate current temperature to N degrees C.
  • During second “buzz”, click N times to set thermal ceiling to 30 C + N.
  • Each “buzz” can be skipped to leave the value as-is.

Includes LVP and smooth thermal regulation, copied directly from Anduril.

Anyone know what output pins are being used in the "NarsilM2C2S.hex" file? Is it Pin 5 for the 7135(s) and Pin 6 for the FET?

[quote=ImA4Wheelr]

That is correct according to channels.h

Thanks WTF. Saw that too, but the 7135 channel isn't working. I'm think I have eliminated potential hardware issues (faulty 7135, connections, etc). So I wondering if the hex file may be using different channels than what the documentation indicates. I'll reexamine hardware again tonight. I may have to build my own hex file if I still can't find a hardware problem.

I just had that happen to me today when stacking three of them, some uncooked solder paste got under the bottom 7135 and shorted it out, next I got a tiny solder bridge to a nearby capacitor. It’s always the simple stuff that causes the most grief.

I wonder if the Attiny has enough power to drive a small led and resistor, it would make a simple test lead to check pwm output. Remove the 7135, turn the light on and probe the Attiny.

The small diode and 220 ohm resistor works fine. There is enough power available to drive four 7135’s and the diode.

I think I’ll get a cheap programming clip and wire up a bunch of led’s on a breadboard.

^

Good stuff. Didn't get a chance to work on the driver tonight, but I'll look out for those types of things when I do. Thank you WTF.

I believe when I researched this before, one pin could output 40ma. I was looking to make a moonlight mode without using a 7135, just the output on that pin for moon mode.

Lamp list round up, to what I know:

Planed lights:
———————————————————

Production lights:
———————————————————

- Haikelite MT09R runs a NarsilM v1.3 beta adjusted bei Texas Ace

- Lumintop GT mini
NarsilM v1.3 beta adjusted bei Texas Ace

  • Lumintop GT70
    NarsilM v1.3 beta adjusted bei Texas Ace

- Fireflies ROT66
NarsilM v1.2 beta adjusted by Lexcel, Fireflies

- BLF GT
NarsilM v1.2

- BLF Q8
NarsilM v1.0

Texas Ace extended the time to get into settings from 8 seconds to 16 seconds.
I think it’s better for Narsil beginner.
I explained it here NarsilM - configurable e-switch firmware for Multi channels, v1.3 - #418 by joechina

This is like a todo list of people/projects to follow up with to make sure the code remains open.

Yeah, I emailed Neal to please post source code links for the GT and GT Mini. Sounds like he's gonna do it right away. There's definitely more. Even Hank at IOS should have links on each flashlight page - think he has it only on 2 of the 5 pages.

This is crazy it's taken off, took a while though. Haven't been keeping up with it, but Andúril should probably be used in place of it. Not sure though, don't think you got the switch LED support in there? But after all, Andúril was the one that saved Middle Earth from the Dark Lord .

Switch LEDs and front-facing aux LEDs are both supported, though not at the same time. Just one or the other. The only difference is whether it should be on at the same time as the main emitters.

During standby, the aux/switch LED can be high, low, off, or blinking. And for a Q8 or GT, with a lighted button, it also goes high/low/off during use, in sync with the main emitters. Usually I set the low-high threshold at the same point as the 7135-to-FET transition, so it indicates which power channel(s) are active.

Ohhh, dang! Forgot bout that, think I heard or saw it posted. Wow! Not sure then if NarsilM does anything at all better...

I got some flexibility in it now to support combos of output channels, but Andúril probably has that covered better.

From what I recall, Narsil was originally built around its mode group UI, giving the user a configurable and carefully-chosen set of discrete levels which hit the sweet spots of each host light, and a fast way to click through them. That is the core; everything else was added later.

Anduril doesn’t have anything like that. There’s a stepped ramp, but it’s totally different than how Narsil works.

After several driver rebuilds, changes, fuse changes, etc, I just about gave up when I found the problem. The LED I was using to test the driver was the problem. It was an old, abused MGT2 that wouldn't turn on until current hit about 720mA. Once on, I could ramp down all the way. Once I swapped in 2S XPG3's, the driver worked great. So much time spent trying to fix a perfectly fine driver. Oh well, lesson learned.

Bugger. Glad you found the problem. :beer:

I understand that frustration completely. I’ve become pretty good at killing Lexel’s new high performance fets, those things don’t like voltage spikes. Accidentally deleting a comma in the Narsil ramping table has the same effect. So much time wasted when you guess wrong and focus on the wrong thing.

Things like this are why I’m going to wire four 5mm leds to a programming clip. One for power and one for every output channel, plan to bring the switch pin out as well as a test point. Easy to put a meter on an output to check for shorts.

Once you see each led turn on dim and go up to maximum intensity you know the Attiny is working correctly and you’re down to a few output devices to troubleshoot.

Clever. That is a great idea!