Fenix E12: 14500, tiny10 FET, XP-G2, 40* TIR. Finally completed!!

I wasnt aware that was changed, I'm visually comparing it (to the first link here http://www.jcapsolutions.com/flashlights/firmware/) and thought it was the same, I didnt mean to change it, what should it be?

this is what you’ll find on the stock version (first link on that page)

PWM_LVL = modes[—mode_idx];

this is what you’ve got that’s different

PWM_LVL =185;

Are you talking about where I changed the turbo timer? I did it like this because I no longer have a definition for "MODE_HIGH_W_TURBO" so I have to physically assign the level I want instead of telling it to use a predefined definition.

#ifdef MODE_TURBO 
    //} else if (ticks == TURBO_TIMEOUT && modes[mode_idx] == MODE_TURBO) { // Doesn't make any sense why this doesn't work
 } else if (ticks == TURBO_TIMEOUT && mode_idx == (mode_cnt - 1)) {
      // Turbo mode is always at end
      PWM_LVL =185;
#endif
 }

}

I see now, good idea.

I don’t see any code problems in that case, assuming you’ve got F_CPU defined and it didn’t come through in your paste. To make matters a little easier on me I renamed your variables back to the stock names, there are very few changes and they all make sense: Saved diff hv94kqvv - Diff Checker

My TIR came today, the lens seems to be glued into the holder :( I'll get the dremil out later and see what can be done, hopefully I can get it cause I was really excited about the new flood beam pattern.

Alright finished up FINALLY!

The TIR came out, not just popped out like I thought but I got it (actually had to melt the holder with a soldering iron). The neutral white 40* beam is very even, no hot spot at all which is about perfect for me in the role this light will fill. I also really like the look of the TIR better than a smooth one, still I’d prefer a reflector but this is more than adequate. Also swapped the XP-E2 for a XP-G2 on a 10mm sinkpad so I could increase the turbo timer up to 60sec, step down was changed to 204 (~80%).

old vs. new

Beam shots coming tonight. The only thing else I’m considering changing is adding one additional mode but i’m not sure, I usually dont like more than 4 modes so I’ll probably just leave it as is, all in all I’m very happy with this whole build, much much better than stock.

Back on the earlier topic of memory: I have now used both on-time and off-time with “no memory” setup. Off-time with no memory is what you want, it behaves exactly as you would expect a light with no memory to act: half presses while the light is on do advance modes, but leaving the light off for a few moments causes it to start in the first mode when turned back on.

Sorry for the delay in checking this out, it ended up not happening until I had a need for it. Go figure right? 0:)

Oh nice…so no capacitor = no memory

Nice!

I might flash that and give it a whirl…thanks

Wait so you can just flash off-time without adding the extra cap?

Damn I hate my broken programmer, I want to play…ordered a set of 40 breadboard jumpers at the same time as my new programmer from the same seller, jumpers came today, programmer won’t be here till Wednesday, WTF…

What? No!

You guys are getting confused. :ghost: You can convert any nanjg based, non-eswitch driver to offtime instead of ontime by adding a capacitor to physical Pin2 and flashing the STAR offtime firmware. For no memory you comment out “#define MEMORY”. THE CAPACITOR IS REQUIRED for this firmware to operate.

Adding the capacitor is simple and easy and you’ve got tons of space for it in this build. Flash the firmware with desired settings and then add the capacitor, it will block your clip. It goes straight from pin2 (star4) to ground.

ok, now I’m confused

so you did add the capacitor, but disabled memory in the code for compiling…is that correct?

so what happens if you don’t have the capacitor?

Think of it as off-time mode switching instead of off-time “memory”.
It has off-time mode switching with no memory.

Helios- is correct.

Off the top of my head, if you leave off the capacitor then you’ll never be able to switch modes, it will stay in the first mode.

Good news, after messing with it for DAYS, I’ve got my old programmer up and running again (no clue what was going wrong but last night I decided to give the old girl one more try and it worked!).

I’ve gotta build and program two more drivers for a guy here in a bit but then I’ll be getting back to this. First goal is to lower moonlight more but then I’ll start working on off-time.

Sounds good! While it’s on my mind, you’ve got some wiggle room on the cap spec if you need it. Look in the STAR firmware discussion thread for HarleyQuin’s post on the subject, but it sounded like anything from 0.5uF to 1.0uF would be fine. A bit more probably won’t hurt anything either.

How do I turn the memory to default off (so soldering the star would turn it on) in STAR on-time?

EDIT, yeah that was simple lol, got it thanks.

// Not soldered (1) should enable memory

memory = ((PINB & (1 << STAR4_PIN)) > 0 ) ? 1 : 0;

So you'll need to fix it to this I believe:

// Not soldered ( 0 ) should disable memory

memory = ((PINB & (1 << STAR4_PIN)) > 0 ) ? 0 : 1;

I just deleted it all together, so the E12 is up and running with on-time and memory turned off, it works exactly how I want a light to work, the only thing is even on 1 I still cant get moonlight all that low. My test bench XM-L2 is alot lower with this exact driver just wired to it, thats the one thing thats still a little dissapointing.

If you like what you have now it’s almost certainly due to not having tried the same thing with offtime.

scenario:
LL-L-M-H (standard on this firmware w/ moonlight)

If I’m in medium and use the light a while and give it a tap, should I end up in LL or H? (ontime makes LL)
What about if I’m in LL for a while? Should a tap just leave me in LL? (ontime makes LL)
I start with the light in LL and tap through to M and immediately turn the light off, which mode should it start in later when I turn the light back on? (ontime makes H )

I can’t imagine a scenario with a reverse clicky where you would want a short tap during usage to reset to the first mode. offtime corrects all of this behavior: in the first example the tap would bring to to H, in the second example the tap would bring you to L. In the third example it will start in LL, as expected when first turning the light on in any scenario using offtime w/out memory.

Sorry for the misunderstanding, it is as of just a little bit ago off-time and yes I love how it is.