NarsilM - configurable e-switch firmware for Multi channels, new v1.2 BETA

390 posts / 0 new
Last post

Pages

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY
NarsilM - configurable e-switch firmware for Multi channels, new v1.2 BETA

BETA Release v1.2:


Oct 16th, 2017:

Here's the latest NarsilM v1.2 files: https://drive.google.com NarsilM v1.2(link is external)

You will find a readme.txt file listing the .HEX pre-configured files there.

 

The tactical mode is now invoked only from ramping from a fast 5X click with the main LED(s) ON or OFF. It can only be disabled from a power cycle. It is very quick, very responsive, and very fast clicks can be used even for a manual strobe.

There's still no updated manual. I still consider it a BETA release for testing.

 

 


 Current Release v1.0:


 

NarsilM is the latest version of Narsil supporting Multi channel output configurations. It supports 1, 2, or 3 output channels in specific configurations using an ATTiny85 MCU.

 

List of features

  • Ramping – smooth 150 level ramping, simple press&hold ramps, 1 click ON to last level, 1 click OFF, direction of ramping will toggle unless you hold to a level for about a second
  • Mode Sets – quick access to lowest and highest modes, 1 click OFF
  • 12 mode sets to choose from, 1 to 8 modes per set including optional moon mode
  • Moon mode (optional) level can be set, modes can be arranged for low to hi, or hi to low
  • Multiple strobe and beacon modes can be accessed, total of 5 special modes (18 Hz strobe, police strobe, bike strobe, 2 sec beacon, and 10 sec beacon), or can be disabled
  • Low Voltage Protection (LVP) – output is decreased starting at 3.0V, shut off at 2.8V, both with blink warnings
  • Timed or Thermal step down can be selected or disabled (works for high output levels in Ramping too)
  • When power is applied, 2 blinks indicate it’s ready
  • An Indicator LED (SMD LED) is supported as a locator LED and low voltage indicator
  • Battery, Temperature Check and firmware version # display – blinked out voltage, temperature in C, and # (ex: 3.7V would be 3 blinks, pause, then 7 blinks)
  • Lock-out feature for the side switch – enabled and disabled by a special click sequence
  • 20 second button press safety lock-out feature (engages lock-out after 20 secs being held)
  • the firmware version # can be blinked out
  • all configuration settings can be reset to the factory defaults
  • very low parasitic drain is supported with using power saving features and design, as low as 22 µA
  • large set of custom compile time settings are supported, documented in one separate header file
  • mode set and ramping tables are in separate header files, can be easily modified without knowing much in "code"

Where to get it

Link to the full available files for download: Google Drive Share for NarsilM

Direct link to the Atmel Studio 7.0 solution/project/source files/notes: NarsilM v1.0.zip

Direct link to AVRDude cmds w/fuse settings, HEX file for (BLF Q8) build: NarsilM hex 2Chan Q8 v1-0.zip

NarsilM Reference Manual

 


Where to get compatible driver boards

There are several boards out there in a wide variety of sizes and form factors that can run NarsilM. Of course the primary requirement is e-switch support, plus it requires the Attiny85 MCU because of the code size. The I/O pins are a little flexible but still have specific requirements.

 

Lexel sales thread using TA boards: http://budgetlightforum.com/node/54053

Texas Avenger triple channel boards: http://budgetlightforum.com/node/48447

DEL two channel boards: http://budgetlightforum.com/node/52397

HarleyQuin BLF SRK board: http://budgetlightforum.com/node/47798

BLF Q8 SRK Driver, in OP: http://budgetlightforum.com/node/45915

 

 The above 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 all developed by DEL then adopted with help from DEL to other designed boards by Texas_Ace and HarleyQuin.

I've used both TA and DEL boards for various lights, and used the HQ BLF SRK board in my 37K lumens 16X XHP50 light running Narsil.

 


 

Tech Info

Here are the current code sizes for the provided configurations using ATMEL Studio 7.0.

** Atmel Studio 7.0 uses the Atmel AVR 8-bit GNU Toolchain (3.5.4.1709) supports all AVR 8-bit devices. The AVR 8-bit Toolchain is based on the free and open-source GCC compiler.

 


 Some Notes

  1. This should be a stable version.
  2. Even though there's lots of flexibility and custom configuration capabilities, it cannot be the do all, end all of e-switch firmware. It's source code is included to allow anyone to change it as they like.
  3. Besides being used in the BLF Q8, it's being planned for use in the upcoming BLF GT and FW3A lights. The buck driver support has already been added and bench tested by DEL, so it is planned to be embedded in a future verison of NarsilM.
  4. I've implemented Narsil/NarislM in many different lights, small to large. I've run it on various driver boards, more recently from Texas Ace, DEL, and Harley Quin. They have the designs with the latest proper updates from DEL that support the Attiny85 working with 7135's and FET's.
  5. I'm hoping this thread can be used as the place for Q and A on NarsilM
  6. I'll be adding more specs/info on NarsilM over the next couple weeks
Edited by: Tom E on 10/16/2017 - 21:46
Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

reserved...

teacher
teacher's picture
Offline
Last seen: 1 hour 16 min ago
Joined: 02/23/2016 - 19:04
Posts: 4108
Location: NE & SW Alabama

Thanks for posting Tom. Smile

      You never know how a horse will pull until you hook him up to a heavy load. / Paul "Bear" Bryant ~/~\~ "Slow is Smooth, Smooth is Fast"

       Texas Lumens Flashlights  <>   M4D M4X Deals : sign up - save $$$$    ||||   Confucius say -- Baaa-haaaaaa......   tongue-out

         Rudeness Level /\ mΩ /\ {width:70%} /\ LightWiki /\ LED Tint Chart /\ LED Tint Picture /\ Xlamp size chart /\ BatteryU                   Flashaholic? Need Professional Help???   wink   /\ TheOriginal /\ TAB /\ LightSearch /\ BatterySearch /\ 14500's /\ DiCal                                                       

giorgoskok
giorgoskok's picture
Offline
Last seen: 1 hour 2 min ago
Joined: 11/13/2015 - 10:46
Posts: 2404
Location: Greece

Thanks Tom .

Tried NarsilM already , and i find it really useful the way it is , now that it is one version for all drivers

sparkyDK
Offline
Last seen: 11 hours 37 min ago
Joined: 04/08/2017 - 11:30
Posts: 332
Location: Denmark

Speaking as the noob i am on matters like this i must say flashlights operating like this bother me a little, but then again it look like if you just put a little time into it you will be able to tweak it more or less to the way you like it. Cool

So right now my favorite are still the push & click wheel on my P 36, but i am eager to get my hands on the Q8 and narsil.
And my U 21 are also working for me, but i think it would take a little getting used to if it was a light i had to use often.

Guess you have to start somewhere, back in the day i also stayed with DOS until win 98se LOL

PBWilson
Offline
Last seen: 6 hours 32 min ago
Joined: 08/24/2016 - 17:49
Posts: 346
Location: Rochester, NY

I also like the idea of tweakability. I can’t wait for my Q8 and FW3A.

dekozn
Offline
Last seen: 13 hours 25 min ago
Joined: 06/17/2016 - 09:04
Posts: 580
Location: Be

Does 3 output channels mean that it s possible to control 3LED separately?
Also is possible too use 2switches like the NC EC21

hank
hank's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 09/04/2011 - 21:52
Posts: 7334
Location: California

Thank you.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

dekozn wrote:
Does 3 output channels mean that it s possible to control 3LED separately?

In theory yes. You could use mode sets to select the channel, but the UI isn't designed for it.

dekozn
Offline
Last seen: 13 hours 25 min ago
Joined: 06/17/2016 - 09:04
Posts: 580
Location: Be

Ok thanks and the double switch?
It’s just that I have that NC EC21 that I can’t get rid of so I’m thinking of modding it with another driver. I also find the red LED underpowered, not enough lumen to light the path you’re walking on. It’s only good for reading something upclose…. I ws hoping I could do it with one of the drivers Lexel is putting together with your firmware.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

Double switch? 2 e-switches? If so, not enough I-O pins.

dekozn
Offline
Last seen: 13 hours 25 min ago
Joined: 06/17/2016 - 09:04
Posts: 580
Location: Be

I think its electronic so nogo. Thanks for the reply and the hard work it s appreciated.

BrianK
Offline
Last seen: 9 hours 28 min ago
Joined: 06/23/2016 - 08:14
Posts: 932
Location: Central Maine, USA

Thanks Tom!

There was an uunexpected bug found not so long ago that you were going to keep in the programming. Were you able to? And is it in the manual?

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

BrianK wrote:
Thanks Tom! There was an uunexpected bug found not so long ago that you were going to keep in the programming. Were you able to? And is it in the manual?

Uhh, maybe? Not sure. New manual is very brief. On the cell now.

MtnDon
MtnDon's picture
Offline
Last seen: 3 hours 27 min ago
Joined: 08/27/2015 - 18:25
Posts: 1525
Location: Expatriate Canadian in New Mexico, USA
Thanks…. looking forward to my Q8 and my drivers from lexel
pepinfaxera
Online
Last seen: 4 min 3 sec ago
Joined: 06/25/2015 - 12:53
Posts: 44
Location: Gijón - Spain

Thank you very much, Tom E.
Now, what Google Translator …
Guide me and do not confuse me.

MRsDNF
MRsDNF's picture
Offline
Last seen: 6 hours 24 min ago
Joined: 12/22/2011 - 21:18
Posts: 11682
Location: A light beam away from the missus in the land of Aus.

Thanks Tom. Thumbs Up

My current and or voltage measurements are only relevent to anything that I measure.

Budget light hobby proudly sponsored by my Mastercard and unknowingly paid for by a hard working wife. 

djozz said "it came with chinese lettering that is chinese to me".

old4570 said "I'm not an expert , so don't suffer from any such technical restrictions".

Old-Lumens. Highly admired and cherished member of Budget Light Forum. 11.5.2011 - 20.12.16. RIP.

 

joechina
Offline
Last seen: 31 min 29 sec ago
Joined: 03/05/2016 - 08:23
Posts: 626

Ah, a new version, so I should write a new cheat sheet.

Wasn’t there a feature if you switch to maximum brightness it does a quick ramp, to not stress the eyes?
A fade from on and a fade to off, like the olight S1R.

Joe

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

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

 

LightRider
LightRider's picture
Offline
Last seen: 3 weeks 2 days ago
Joined: 08/05/2015 - 09:52
Posts: 2007
Location: U.P. MI, USA
dekozn wrote:
Ok thanks and the double switch? It’s just that I have that NC EC21 that I can’t get rid of so I’m thinking of modding it with another driver. I also find the red LED underpowered, not enough lumen to light the path you’re walking on. It’s only good for reading something upclose…. I ws hoping I could do it with one of the drivers Lexel is putting together with your firmware.

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

Tom E wrote:

BrianK wrote:
Thanks Tom! There was an uunexpected bug found not so long ago that you were going to keep in the programming. Were you able to? And is it in the manual?

Uhh, maybe? Not sure. New manual is very brief. On the cell now.

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 smile.

 

joechina wrote:
Ah, a new version, so I should write a new cheat sheet. Wasn't there a feature if you switch to maximum brightness it does a quick ramp, to not stress the eyes? A fade from on and a fade to off, like the olight S1R. Joe

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 smile.

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

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

LightRider wrote:
dekozn wrote:
Ok thanks and the double switch? It's just that I have that NC EC21 that I can't get rid of so I'm thinking of modding it with another driver. I also find the red LED underpowered, not enough lumen to light the path you're walking on. It's only good for reading something upclose.... I ws hoping I could do it with one of the drivers Lexel is putting together with your firmware.
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.

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

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.

dekozn
Offline
Last seen: 13 hours 25 min ago
Joined: 06/17/2016 - 09:04
Posts: 580
Location: Be

Tom E wrote:

LightRider wrote:
dekozn wrote:
Ok thanks and the double switch? It’s just that I have that NC EC21 that I can’t get rid of so I’m thinking of modding it with another driver. I also find the red LED underpowered, not enough lumen to light the path you’re walking on. It’s only good for reading something upclose…. I ws hoping I could do it with one of the drivers Lexel is putting together with your firmware.
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.

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.


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.
hank
hank's picture
Offline
Last seen: 1 day 7 hours ago
Joined: 09/04/2011 - 21:52
Posts: 7334
Location: California
Quote:
more blinky modes, like lightning

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

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

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 smilefrown.

 

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.

 

joechina
Offline
Last seen: 31 min 29 sec ago
Joined: 03/05/2016 - 08:23
Posts: 626

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

MRsDNF
MRsDNF's picture
Offline
Last seen: 6 hours 24 min ago
Joined: 12/22/2011 - 21:18
Posts: 11682
Location: A light beam away from the missus in the land of Aus.

joechina wrote:
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

My current and or voltage measurements are only relevent to anything that I measure.

Budget light hobby proudly sponsored by my Mastercard and unknowingly paid for by a hard working wife. 

djozz said "it came with chinese lettering that is chinese to me".

old4570 said "I'm not an expert , so don't suffer from any such technical restrictions".

Old-Lumens. Highly admired and cherished member of Budget Light Forum. 11.5.2011 - 20.12.16. RIP.

 

Tom E
Tom E's picture
Offline
Last seen: 4 hours 54 min ago
Joined: 08/19/2012 - 08:23
Posts: 10853
Location: LI NY

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.

MtnDon
MtnDon's picture
Offline
Last seen: 3 hours 27 min ago
Joined: 08/27/2015 - 18:25
Posts: 1525
Location: Expatriate Canadian in New Mexico, USA

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

joechina
Offline
Last seen: 31 min 29 sec ago
Joined: 03/05/2016 - 08:23
Posts: 626

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

Pages