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

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.

I’ve also been meaning to sync NarsilM’s updates to my repository, but with my main PC still out of commission everything is a little awkward. I really miss having a decent keyboard, multiple screens, and enough RAM.

If you want ramping in a light which only has a tail on/off switch, there’s a separate project (Crescendo) for that. But if you want it in a dual-switch light (e-switch plus tail on/off), I’m not sure if there is currently a good option… probably a future version of Narsil.

Psst… MELD-x with colors disabled

Tom, does Narsil M, in a 2S configuration, do LVP and temp control at same time or do you still have to choose only one?

I think this version was supposed to let you switch between the 2 choices.

Thanks Tom .

:+1:

Yes - I'm using in a L6, TA L6 board, with the proper resistor values and tested it to be accurate with battery level readings, and you still have full choice of temperature or timed step down. Parasitic drain is only 62 uA - nice for an LDO 2S setup. I have support for both LVP monitoring methods:

  • internal 1.1V reference with no need for R1/R2 (1S only!)
  • external R1/R2 support (I now use it only for 2S setups, but it can still be configured for 1S if you prefer)

Both methods are interrupt driven to do the AtoD readings.

You're welcome, and Thank You!

For “TA” LDO Driver series. Is the part value the same?

R1: 220 k for e-switch lights
R2: 47 k for e-switch lights
R3: 100 k
R4: 47 ohm
R5: 4.7 ohm
R6: 1206 0 ohm jumper
R7: 1206 0 ohm jumper
C1: 10 uF
C2: 0.1 uF

Right, I keep forgetting that MELD can be used as SELD instead. And, um, usually I just check the index file in my repository to find suitable firmware, so I tend to miss it.

Anyway, there’s lots of cool stuff lately and I hope I’ll be able to catch up on some of it soon. :slight_smile:

No, this is wrong - has a couple of problems - wrong value for R1 and C2 should be a 10 uF. Need couple minutes. PhotoBucket seems down right now.

Edit:

R1 should be 360K - noted in setups.h. That's what my default tables in the header file: tk-calibWight.h is set up for.

C2, for an LDO, is changed from a 0.1 uF to a 10 uF. Believe this is standard for our drivers when using an LDO. It's a make-do-with-what-we-got sort of thing. Be sure you use a proper LDO though. I got a part # somewhere... I know it's been mentioned, but I'm sure Lexel is using a proper one.

PhotoBucket still down - may be a long one. I got a pic of my L6 TA driver posted somewhere... That's what I was trying to get. Oh boy, should really be adding more info in the OP.

Oops, back up:

I should have used the SIR 404DP if I knew the XHP70.2 would be so high in amps. Can't tell, but C2 is a 10 uF cap.

Yes,

There should be a lot of people who need a “Muggle” Assembly information.

Especially, How to flash firmware. (avrusb.bat)

When setting up NarsilM to do triple builds I found one thing in setup.h where I am puzled

#define D1_DIODE 2 // Drop over rev. polarity protection diode: 0.2V normally, 0.3V for Q8

the value is set to 2, but comments say 0.2 or 0.3V

next mode sets for triple channel has a bug for 6. mode
5% mode and 10% mode have both 7135 bank set to 0, but 10% need a value like 60 or so

// 6 modes 0.8-2-5-10-50-max ~0.8% ~2% ~5% ~10% ~50% max
PROGMEM const byte mode7135Set6 = { 20, 110, 255, 255, 0, 0};
PROGMEM const byte mode7135sSet6 ={ 0, 0, 0, 0, 255, 0};
PROGMEM const byte modeFetSet6 = { 0, 0, 0, 0, 0, 255};

for reference this is my custom mode set file

Ramping table has still only 12 values for FET on 7135*8 set up

this is my customized ramp table which works better

for the temp calibration values I got also some drivers qith positive value
but for NarsilM is the temp calibration value just wasted space as it uses the config menu to read temp value when you stop heating the light?

two questions

#define D1_DIODE 2 // Drop over rev. polarity protection diode: 0.2V normally, 0.3V for Q8

if I use R1/R2 on a 2S LDO board do I need to comment this out?

in config menu, is it possible to add a timed+temperature?
and how does it work 2 settings in one menu point

3
Thermal/timed stepdown
1=disable, 2= Temperature, 3=timed
Timed: 1=60secs, 2=90secs, 3=2 mins, 4=3 mins, 5=5 mins, 6=7 mins
3-4

so first try to compile NarsilM for TA triple board using R1/R2 reference

I got a ton of errors

Maybe not enough time now to answer all this.

  • The last errors - works for me. I've been using R1/R2 for 2S. No need to use it for 1S, so I don't, plus not having R1/R2 reduces parasitic drain. Are you sure you uncommented either the 220K or 360K define?

// For voltage monitoring on pin #7, only uncomment one of the two def's below:
//#define USING_220K // for using the 220K resistor
//#define USING_360K // for using a 360K resistor (LDO and 2S cells)

  • I'll drop in your ramping table - sounds/looks much better!
  • The D1_DIODE value is in 10th's of a volt - thought that was obvious and commented as such?
  • The 3-4, is 3 for timed, then 4 for the 4th timed choice. Again, thought this was obvious - 2 settings, 2 default values, maybe not?

I uncommented 360k

but those
TIMED_STEPDOWN_SET
byInitADCTimer

errors are still there