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

513 posts / 0 new
Last post
Niko
Offline
Last seen: 1 month 3 days ago
Joined: 02/08/2018 - 09:55
Posts: 166
Location: in der lampe

How to remove momentary mide in narsil code?

joechina
Offline
Last seen: 6 months 6 days ago
Joined: 03/05/2016 - 08:23
Posts: 1459
Location: Germany

Can I have different stepp downs for
RAMPING (e.g. timed 3min) and MODES (e.g. temperature step down) ?

Or different times for the step down?

Joe

BlueSwordM
BlueSwordM's picture
Offline
Last seen: 5 days 9 hours ago
Joined: 11/29/2017 - 12:34
Posts: 5608
Location: Canada

Yes.

If you are in ramping, hold the button for 8 seconds until you get to the settings configuration.

There is going to be this array of options:

1. 2 quick flashes, 1 slow flash = Mode set(1 click), ramping (2 clicks) Do not touch. Wait until it goes to the next mode below.

2. 2 quick flashes, 2 slow flashes = Moonlight levels. Do not touch. Wait until it goes to the next mode below.

3. 2 quick flashes, 3 slow flashes:

- 1 click = Stepdown disabled. Not recommended.

- 2 clicks = Temperature stepdown. Goes to max, and then you click the button when the flashlights is too hot for you to hold it.

- 3 clicks = Timed. Then your press according to the time you want it to step down at:

1 click = 60 seconds. 2 clicks = 90 seconds. 3 clicks = 120 seconds. 4 clicks = 180 seconds. 5 clicks= 5 minutes. 6 clicks = 6 minutes.

My very own high current Beryllium Copper springs Gen 3:
http://budgetlightforum.com/node/67401
Liitokala Aliexpress Stores Battery Fraud: http://budgetlightforum.com/node/60547

JasonWW
JasonWW's picture
Offline
Last seen: 11 hours 7 min ago
Joined: 10/22/2016 - 11:41
Posts: 12911
Location: Houston Texas

joechina wrote:
Can I have different stepp downs for
RAMPING (e.g. timed 3min) and MODES (e.g. temperature step down) ?

Or different times for the step down?

Joe


I’m almost certain the answer is no. When you set the step down in ramping it automatically carries over to the mode sets and vice versa. So I don’t think there’s any way you can separate them. Besides, I’m not sure why you would want different step-downs between ramping and mode sets in the first place.

Texas Ace Lumen Tube and JoshK Sphere calibrated with Maukka lights

Click this to go to signature links. I'm still around, just not reading many new threads.

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

Is it possible for dual switch lights to make the side button only switch modes so the light can opnly be turned off with tail switch?

joechina
Offline
Last seen: 6 months 6 days ago
Joined: 03/05/2016 - 08:23
Posts: 1459
Location: Germany

JasonWW wrote:
joechina wrote:
Can I have different stepp downs for
RAMPING (e.g. timed 3min) and MODES (e.g. temperature step down) ?

Or different times for the step down?

Joe


I’m almost certain the answer is no. When you set the step down in ramping it automatically carries over to the mode sets and vice versa. So I don’t think there’s any way you can separate them. Besides, I’m not sure why you would want different step-downs in the first place.

The reason I ask is, I found an older entry on the german forum where it should work.
He said he has in one moon aktiv in the other not.
I never tested it and have also doubts, so I asked here

https://www.taschenlampen-forum.de/threads/blf-q8-friends.59475/#post-89...
Maybe he mixed sth. up

Joe

JasonWW
JasonWW's picture
Offline
Last seen: 11 hours 7 min ago
Joined: 10/22/2016 - 11:41
Posts: 12911
Location: Houston Texas

joechina wrote:
JasonWW wrote:
joechina wrote:
Can I have different stepp downs for
RAMPING (e.g. timed 3min) and MODES (e.g. temperature step down) ?

Or different times for the step down?

Joe


I’m almost certain the answer is no. When you set the step down in ramping it automatically carries over to the mode sets and vice versa. So I don’t think there’s any way you can separate them. Besides, I’m not sure why you would want different step-downs in the first place.

The reason I ask is, I found an older entry on the german forum where it should work.
He said he has in one moon aktiv in the other not.
I never tested it and have also doubts, so I asked here

https://www.taschenlampen-forum.de/threads/blf-q8-friends.59475/#post-89...
Maybe he mixed sth. up

Joe


I’ve never tested it either. I’m not a fan of mode sets and never use them.

I can’t test it right now, so maybe someone will try or maybe TK will know.

(It’s also important to specify which version of Narsil your using as they each have small changes. It looks like he’s talking about NarsilM v 1.0.)

Texas Ace Lumen Tube and JoshK Sphere calibrated with Maukka lights

Click this to go to signature links. I'm still around, just not reading many new threads.

joechina
Offline
Last seen: 6 months 6 days ago
Joined: 03/05/2016 - 08:23
Posts: 1459
Location: Germany

Yes, it should be NarsilM v1.0 . He bought a stock one.
It’s midnight here I don’t test anything tonight, sorry Smile

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.

joechina wrote:
Can I have different stepp downs for
RAMPING (e.g. timed 3min) and MODES (e.g. temperature step down) ?

Or different times for the step down?

No.

Looking at the code, it has only one value which is shared across both. Tom documented it in the comment for SaveConfig():

/**************************************************************************************
* SaveConfig - save the current mode with config settings
* ======
*  Central method for writing (with wear leveling)
*
*  config1 - 1st byte of stored configuration settings:
*   bits 0-2: mode index (0..7), for clicky mode switching
*   bits 3-6: selected mode set (0..11)
*   bit 7:    ramping mode
*
*  config2 - 2nd byte of stored configuration settings:
*   bit    0: mode ordering, 1=hi to lo, 0=lo to hi
*   bit    1: mode memory for the e-switch - 1=enabled, 0=disabled
*   bit  2-4: moonlight level, 1-7 enabled on the PWM value of 1-7, 0=disabled
*   bits 5-7: stepdown: 0=disabled, 1=thermal, 2=60s, 3=90s, 4=2min, 5=3min, 6=5min, 7=7min
*
*  config3 - 3rd byte of stored configuration settings:
*   bit    0: 1: Do OFF time mode memory on power switching (tailswitch), 0: disabled
*   bit    1: On Board LED support - 1=enabled, 0=disabled
*   bit    2: Locator LED feature (ON when light is OFF) - 1=enabled, 0=disabled
*   bit    3: BVLD LED Only - 1=BVLD only w/onboard LED, 0=both primary and onboard LED's are used
*   bit    4: 1: moonlight mode - 1=enabled, 0=disabled
*   bit  5-6: blinky mode config: 1=strobe only, 2=all blinkies, 0=disable
*
**************************************************************************************/
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.
Lexel wrote:
Is it possible for dual switch lights to make the side button only switch modes so the light can opnly be turned off with tail switch?

Yes, but I don’t think the repository has anything like that yet. A new UI would need to be created.

joechina
Offline
Last seen: 6 months 6 days ago
Joined: 03/05/2016 - 08:23
Posts: 1459
Location: Germany

Thank you for your clarification, Toykeeper!

Good night

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany
ToyKeeper wrote:
Lexel wrote:
Is it possible for dual switch lights to make the side button only switch modes so the light can opnly be turned off with tail switch?

Yes, but I don’t think the repository has anything like that yet. A new UI would need to be created.

I thought about exploiting the lock timing to be infinite or removed
If the firmware does not lock the mode in after 1.2s it would all the time ready to change modes

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.
Lexel wrote:
I thought about exploiting the lock timing to be infinite or removed If the firmware does not lock the mode in after 1.2s it would all the time ready to change modes

What would an e-switch button click do in the ramping mode?

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany
ToyKeeper wrote:
Lexel wrote:
I thought about exploiting the lock timing to be infinite or removed If the firmware does not lock the mode in after 1.2s it would all the time ready to change modes

What would an e-switch button click do in the ramping mode?

ramping does not use the 1.2s mode lock timer its only used in modes set
I cant program so I do not know what ecxactly to change to get this timer set to infinite or disable it

so in ramping side switch has normal operation including putting the light in standby

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.
Lexel wrote:
ToyKeeper wrote:
What would an e-switch button click do in the ramping mode?

I cant program so I do not know what ecxactly to change …
so in ramping side switch has normal operation including putting the light in standby

I mean, ideally. How would you want it to work, if you could do it however you like?

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany
ToyKeeper wrote:
Lexel wrote:
ToyKeeper wrote:
What would an e-switch button click do in the ramping mode?

I cant program so I do not know what ecxactly to change …
so in ramping side switch has normal operation including putting the light in standby

I mean, ideally. How would you want it to work, if you could do it however you like?

in mode sets
Tail switch on/off
Side switch short press next mode
side switch long last mode

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.
Lexel wrote:
ToyKeeper wrote:
I mean, ideally. How would you want it to work, if you could do it however you like?

in mode sets
Tail switch on/off
Side switch short press next mode
side switch long last mode

So, no ramping UI at all?

Mostly, I was wondering how you’d want a ramping interface to work when the tail clicky is the only way to turn the light on/off. Like, what would happen when the user clicked the e-switch. But “no ramping” is also an answer to that question.

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany
ToyKeeper wrote:
Lexel wrote:
ToyKeeper wrote:
I mean, ideally. How would you want it to work, if you could do it however you like?

in mode sets
Tail switch on/off
Side switch short press next mode
side switch long last mode

So, no ramping UI at all?

Mostly, I was wondering how you’d want a ramping interface to work when the tail clicky is the only way to turn the light on/off. Like, what would happen when the user clicked the e-switch. But “no ramping” is also an answer to that question.

No ramping untouched, just the lock timer in Modes removed

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

For a Forum member I am trying to get NarsilM first time individually set up on Modes
never used modes before myself

But I am stuck due to a bug

He wanted that the light has Mode memory when the light was powered down with tail switch

There is a switch in Setup file named
#define OFFTIME_ENABLE 1
// 1: Do OFF time mode memory for Mode Sets on power switching (tailswitch), 0: disabled

Problem it its bugged when I turn on the light it has Next Mode Memory, so it gets to next mode after a power disconnection

If its meant to do next mode memory good feature if not bug, both would be great

maybe the code is OK but MCU does not like low voltages before shut down and notices a click before its off

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.

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?

Lexel
Lexel's picture
Offline
Last seen: 1 year 2 months ago
Joined: 11/01/2016 - 08:00
Posts: 5895
Location: Germany

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

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 week 1 day ago
Joined: 01/12/2013 - 14:40
Posts: 10827
Location: (469219) 2016 HO3 // I get way more privmsgs than I can respond to, so please ask in a public thread if possible, for a faster answer.

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.

ImA4Wheelr
Offline
Last seen: 4 months 1 week ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

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?

WTF
Offline
Last seen: 12 months 1 day ago
Joined: 03/05/2017 - 20:13
Posts: 318

[quote=ImA4Wheelr]

That is correct according to channels.h

ImA4Wheelr
Offline
Last seen: 4 months 1 week ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

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.

WTF
Offline
Last seen: 12 months 1 day ago
Joined: 03/05/2017 - 20:13
Posts: 318

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.

WTF
Offline
Last seen: 12 months 1 day ago
Joined: 03/05/2017 - 20:13
Posts: 318

WTF wrote:

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.

ImA4Wheelr
Offline
Last seen: 4 months 1 week ago
Joined: 02/03/2013 - 14:51
Posts: 7935
Location: SC

^

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.

moderator007
moderator007's picture
Offline
Last seen: 2 hours 15 min ago
Joined: 12/23/2012 - 04:47
Posts: 3767
Location: North Carolina

WTF wrote:

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.


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.
joechina
Offline
Last seen: 6 months 6 days ago
Joined: 03/05/2016 - 08:23
Posts: 1459
Location: Germany

Lamp list round up, to what I know:

Planed lights:
———————————————————
- Q8:
Sofirn want to do a newer version
long one Q8 v1.5
http://budgetlightforum.com/node/61004
Don’t know about the firmware

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 http://budgetlightforum.com/comment/1309206#comment-1309206

Pages