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

Minor updates to the reference manual now posted:

  • typo: clicks --> blinks
  • added the list of special (blinky) modes
  • added hidden/cheat method description to turn off the indicator LED

ttrev has the meld driver. It’s designed for multicolor lights but it can be used with a single white and has double e-switch support. The firmware has an option to run both a primary white and a secondary emitter/laser. I believe you could take advantage of the ec21 by adding a better red led or a laser like ttrev did to his. Check into it anyway as my information may not be spot on.

Ok - think you are referring to the method to turn the Indicator LED off - from OFF: click to ON, then quickly click OFF. This will leave the Indicator off when the main LED is off. I added this now to the reference manual .

Dang, I recall this being discussed but forgot bout it. I'm maintaining a list of open issues, so I'll add this to the list -- ok, OpenIssues.txt is updated .

List so far is below, but it's a work-in-progress that would probably never end

Open Issues
-----------
- FIXED: Tom E: in mode sets, step down settings wasn't working correctly
- FIXED: 1 Lexel/BLF spotted: Blinkies unable to turn off in ramping
- FIXED: delay processing of fast click operations to avoid max/turbo flash and allow more fast
click options (over 4 doesn't work)
- re-work triple channel ramping tables: add more to the FET range, check/test for different
# of 7135's in the bank (5/27: not sure this is necessary now with new 3 chan ramping table)
- add in buck driver support cleanly

Possible New Features
---------------------
- joechina recommended to do a quick ramp to max, maybe even quick fade to OFF to ease tension to
the eyes. The Olight A1R does this.
- research "bump protection" - tolerate a short loss of power
- build in a method to show the current config settings
- more blinky modes, like lightning, etc.

Yea, ttrev designed the meld driver around being able to control separate LED's, plus the driver is designed to match so that's a big advantage. Also he uses PIC MCU's which have more capabilities than the ATMEL's we are currently using. That sort of capability is better suited for the ATMEL's with much more I/O pins. I'd rather go straight to the ATMEL ATtiny1617 that has twice the memory of the ATtiny85 and much more I/O pins.

OP updated. There will be more info added, just not sure yet where/how to organize it yet.

I need to get this latest version installed in some of my more favorite lights.

I tested the one channel configuration on the FET of a 2 channel board in a SupFire L5. The low levels in ramping don't look smooth - not sure what's goin on there - there's noticeable flicker. Might be the high PWM rate combined with low PWM value driving the FET, not sure.

Sorry I missed all this. I knew about the meld driver but I tought it would be overkill for one LED and one through hole red LED. I wouldn’t mind using the red LED like an indicator LED, modify the firmware a bit so that it stays on instead of blinking but the 2 switches should still be operational. But I’ll have another look into that driver. Thank you for the replies and sorry for the OT.

Taser mode wired through the spikes on a ‘tactical bezel’?

Dunno why I stuck that on the list - really hard to tell whether it was a serious request or not. I have no plans to do it, unless I was totally bored which I don't see anytime soon .

Edit - Important Update

I just updated the source and HEX files. Realized I had the default moon mode set to a PWM value of 4, thinking it may help on certain 7135's -- had to back that change out. It's now restored to a default moon mode level of 3 (not 4). 3 is the value documented in the reference manual, so now the code matches.

F-Memory

Tom you said with a newer uC there would be more code space available.

So may I ask if more options for mode memory are possible?

I would love to have f.-memory (forgetting memory) or Alzheimer memory.
So the lamp remembers the last level a certain time and then forget it. Like I do.

I got my first lamp with mode memory for EDC and I think I don’t like it. I am constantly in the wrong mode. I think I got spoiled by the Tool AAA.
I’d rather have a fixed (user selectable) brightness level, about 35 lm, after I have forgotten what the last level was.

Would it be possible in Narsil to add two options for memory in RAMPING ?

- memory (the now default)

- f-memory for 5 to 15min (user selectable) then falls back to a fixed level

  • fixed 35lm (user selectable), no memory. The lamp starts always with it at one click from OFF.

I like having a fixed level because it is always there and I don’t have to think before. Otherwise I have to readjust the level if it starts in Moon. Or readjust if it starts with memoriesed level.
It’s one click and in 95 percent I have the right amount of light.
I guess it’s also easier than ramping up from moon and releasing in the right moment.

Any opinions about this?

Joechina

You can set the moon mode to whatever level of brightness that suits you, switch the light on to the moon mode and then if you ramp up from there the ramping starts at minimum going to maximum brightness

Oh no! My reply got lost... Here it goes again.

Still using the Attiny85, so still got 8 KB for code. Got about 1 KB space left for a 2 channel Q8 build.

I think I understand what you are asking for, and it's do-able accept maybe for the 5-15 minute time out. There's no RTC (clock chip) like what you have in cell phones, laptops, etc., and the MCU goes in to a deep sleep to save power while the main LED is OFF. It's possible to do some power saving method to keep a timer running and periodically wake up every few seconds, but that's something I don't know how to do, would have to figure out, if it's even possible, and if so, would add to the parasitic drain I'm sure. The real problem for me is time, time to research, time to develop, and how many would want and use this feature for the added complexity? Hard to say.

Forgetting memory sounds interesting, however I am happy if it will always start on a low / moonlight setting like all my other favorites do.

I wouldn’t mind if the 5min wold be 4.
Maybe this works:
You do a cyclic battery check e.g. every 4sec. You set a counter with it. So a value of 15 equals 1min.
At a value 75 = 5min the memoriesed value is overwritten.

sorry if it’s completely nonsense

I don't understand - you do want the timeout to be whether is light is ON or OFF? There is no battery check when the light is in a deep sleep - 5 seconds after its turned OFF it enters the deep sleep mode where only a button press wakes it up.

MRsDNF
I don’t think Narsil can moonlight from 25 to 50 lumen, that would be my default brightness.

I know Narsil starts in MOON with a click&hold. My point is, I have to think again with every lamp: What is the UI? What does a click&hold? How do I change brightness? Tap or hold?

It’s grabbing the light, one klick, enough light for within arm lenght. The next click is off.

It is about not thinking.

Like a tool, a screwdriver on the pegboard at the workbench, you grab it and use it.

My hunch is operation gets easier.

Joe

Yes, timeout in On and Off

I didn’t know it goes direct to deep sleep, so I am sorry for writing nonsense.

you can change the code for higher moonlight
in ramping its easy just edit the ramping table
for mode operation I dont know where to start to get MM at 50 lumens

BUT if you dont care for code you could simply add a capacitor on a tiny FET to the single AMC channel
it switches on when the driver gives a signal to the single AMC channel
then just wire a resistor for 50 lumens to the LED minus

How would this software react to having a tail cap on/off switch? Is there a suggested hardware that currently supports this firmware? Something in the 17 to 22mm size range?

Was planning on adding links. Lexel has been building/selling TA boards that run Narsil. I would use either TA or DEL boards. I'll add the links to at least the driver board threads to the OP now -- links added!

TA, DEL, and HQ board designs have the extra parts to properly support the ATtiny85, either the 85 full pad size or mounting via the bent pin method. The extra parts (from original Attiny13A designs) were developed by DEL. Standard sizes of 17, 20, and 22 mm are available in both TA's and DEL's designs.

About the tail switch, there's compile time support for one that works for mode changing but only in mode set operation, not ramping. Otherwise, a tail power switch would simply be power ON/OFF. In ramping if you power off the light, you lose the last used level.

In case it helps at all, this is exactly what the soft-start code in bistro was intended for. It intercepts all brightness changes and makes the transition smooth. Bistro doesn’t use it much though, since the button cuts power. It was more about making things easier later if anyone ever made an e-switch UI based on it.

So, there may be code which can be copy/pasted if this feature is desired.