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

What exactly is bad with the sailboat 7135? I just got some of them from Intl-outdoors and was thinking of stacking them on a convoy driver.

So, we got the normal 3 channel TA board working as a 2 channel FET+1 with 1 cell.

Now, what would need to be done to get the TA 20-30mm LDO board to work as a 1 channel FET only 2s+ cells?

I have the 30mm TA LDO built. I'm using the MIC5235-5.0YM5 LDO with R1 of 360k and R2 at 47k, C1 and C2 at 10uf, R3 100k, R4 47 ohm, R5 4.7 ohm, R6 0 ohm jumper, R7 0 ohm jumper, D1 nothing ? , SIR800 FET, and Attiny85V 10SU.

Is the D1 Schottky required with the LDO 2s?

I reassigned the pins in the RegisterSettings.h, made the change in the main() to enable PWM on pin 3, used the Setups-1Chan.h, un commented #define USING_360K, commented out the #define D1_DIODE 2. Fuses are lfuse 0xE2, hfuse 0xDE, efuse 0xff.

When I connect power to the driver, 2s connected to an MTG2, the led erratically flickers for several seconds until it finally blinks 2wice and stops for awhile. It'll ramp up and down, do turbo, bat check, strobes and then all of a sudden it's doing its own thing. It'll ramp to max on its own and I'm unable to shut it off or anything else with the e switch. Sometimes it works but most of the time it's Psycho!

I've swapped the caps, MCU and the FET. I've tried a few different things with the firmware but it's always the same

I'm sure there's something super simple I'm missing. Please help...

Nothing wrong with the sailboat for 4.2v 1 cell drivers. They work.

It's when you use 8.4v 2+ cells in series that they'll fry.

I’m not sure why it didn’t work for you. It worked for me:

https://pastebin.ca/3870461

However, there is one caveat. For some reason, after booting in moon mode, it refuses to ramp until after turning the light off and back on. Instead of holding to ramp, it needs a “click, release, hold” to ramp the first time. No idea why, and I didn’t see an obvious fix. It still responds for other hold events though, like entering config mode or triggering the auto-lockout after 20 seconds. But I think maybe the “holdHandled” var is getting stuck in the wrong state somehow until after a regular click.

That’s probably a task for reviewers. With so many people getting a Q8 soon, there will probably be runtime graphs in some of the reviews.

Narsil doesn’t really know or care how much battery capacity there is or how the battery’s discharge curve looks, so it isn’t going to be giving any good remaining runtime estimates. When voltage gets too low, it reduces output. Then it keeps going until voltage gets too low again. If this happens when the output is already on the floor, it shuts off. It has no idea how long each step will last. It depends on a bunch of factors, including what kind of batteries are used.

People dislike the failboat 7135 chips because their activation speed is so slow. IIRC, they don’t light up most LEDs until a PWM level of about 6/255, and they’re pretty unstable at the low end so they’re bad for lights with a moon mode. The minimum output also tends to vary quite a bit with cell voltage, which is undesirable.

Other 7135 chips have much better low-end response, and are generally preferred for that reason. Some of the best ones give a nice stable moon mode at level 1/255, some require 2 or 3, and others have even higher floor levels.

What host do you use to test new NarsilM versions?

NarsilM works on a wide variety of lights, so it’s fairly easy to find a test host for features which aren’t hardware-specific. I’ve used an Emisar D4 and a SRK with prototype Q8 driver, or of course the Q8 works well. Or almost anything with an e-switch and a FET/7135-based driver.

But mostly I use a decapitated D4 with the driver hanging out. Hank sent me some parts which were prototypes or which failed QA, and I use them for development purposes:

Oh, um, also an adjustable bench power supply. It’s particularly helpful for testing LVP. I ended up with a couple due to some phone-related stuff I was doing…

But if one of those isn’t available, it also works to simply hold wires onto a battery.

Thanks TK, I’ll give your code a try. On first glance I see the difference in what we did — I was putting my if-else statement inside the if(ramping) statement instead of outside and duplicating the check. Not sure what the difference is functionally since only one branch of that code is going to run anyway, but I guess there is one. I’ll pull up my edits and compare. Thank you!

Can confirm that code works on my setup too. Not sure what I was doing wrong, but thanks! I do have the same ‘bug’ you report, the ramping doesn’t work until the driver is cycled off and back on using the e-switch, and its got other flakiness like cycling off if you release the side switch too soon after power-up, but its a start. Thanks again!

Is it possible to (Compile) and (Assemble) a NarsilMv10-31s.hex?

Put it on the OP link.

I wish mod a Manker U11 (4 LED)(side switch)

So I figured this out. For some reason the switch pin on the MCU was malfunctioning. I was poking around with the dmm and noticed there was 21k ohm from the switch pin to ground. I thought maybe the eswitch was the source but after some more troubleshooting I removed the MCU and measured from the ground pin to the switch pin and it was 21k ohm. A new unused MCU measured several mega ohms. After swapping the MCU it works...

I think this was discussed in the Q8 thread but that moves so darn fast it’s well buried by now and can’t find it.

Is there an easy way or shortcut to 100% 7135 while in ramping mode? Only way I know of is to yo-yo between 1 and 2 button blinks to indicate 7135 or fet

To my knowledge there is no Shortcut to full 7135 in NarsilM v1.0.

The Emisar lamps have one.

Hello Tom I posted in the Q8 Mod thread, but I think it belongs here

Sorry, haven't been able to keep up with this thread - will try from now on. Thanks TK for the help and support! Lots of things goin on with the Q8's.

One more BUG added, thanks to joechina... that's a good thing that he found it, I think . Really haven't been able to spend any time on firmware lately. For some reason I keep playing VOB's youtube review of the BLF GT over and over again, featured here on REDDIT. The 5:00 to 6:00 section features NarsilM - my favorite part .

Here's the latest Open Issues:

Open Issues
-----------
- 2017/10/04: BUG: in LVP switch LED control: the LED sometimes is left on after an LVP drop,
and is not blinking the way it should be. The "bug" is that I'm trying to control the
switch LEDs from multiple places so it's getting turned off quickly after turned on, and
left on when it should be left off. It's a timing thing, so has sort of a random
pattern - sometimes left on, sometimes left off.
The 8 sec LVP blink need to be qualified better, and should not be calling Setlevel() as is
because it wants to control the LED

- 2017/10/01: temp stepdown should not happen right away from turn ON. Delay it, least by
15 seconds!

- 2017/09/29: BUG: for temperature stepdown, where in moon mode, a temp stepdown is
actually done because moon mode is marked as special level 255, which is considerred as a
high level of output instead of very low. The stepdown results in the light switching much
brighter. This should only happen id the temperature threshold is set to a low temp, or the
light is still hot and not cooled down when moon mode is chosen. It can also result in an
immediate jump to the stepdown level as soon as the light is turned on in moon mode. Might
appear as a bright flash when ramping first starts.

- 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)

- (from JasonWWW) triple channel mode sets are not completely defined, and are different than 2
chans - need to, at a minimum, document it this way
- (from JasonWWW) possible problem with mode memory in 3 chan config - must check it out

Possible New Features
---------------------
- besides supporting turbo/max on power up, add support if powered up with the button pressed,
come up in moon (lowest) mode
- 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.
- enhancing tailswitch support: full mode sets w/memory (Lexel)
- add ability to have timed and temp step down simultaneously (Lexel)
- research "bump protection" - tolerate a short loss of power
- build in a method to show the current config settings
- more blinky modes, like lightning, campfire, etc.

Done Issues/Features
- 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)
- DONE: add in buck driver support cleanly (BLF GT)
- DONE: add momentary/tactical mode

Thanks for the work Tom. :+1:

Tom for the BLF GT in batt check mode is the voltage blinked out per cell? Not blinked out for 16v 4s pack? 4 blinks, a pause then 2 blinks means I have 4.2V per cell?

Right. Yes, it's measuring 4S coming in, but displaying on a per cell basic. DEL did all the work there to get it right with proper resistor values, then wrote the code for measuring it, etc. He took Narsil and fuly modded it to support the driver, then later, I ported and combined it into one NarsilM version, so buck driver support is now melded in with the 1, 2, and 3 channel support in NarsilM.

Ohhh - did the 5X click for tactical mode work?

It usually blinks the per cell voltage. So nothing higher than 4.2.

I’m sure Tom will confirm that when he checks here.

EDIT, That was quick. Lol