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

I think you still didn’t get a good paste, the beginning is missing some stuff. Good enough to do a diff though, ignoring that stuff:

I’m not sure why you changed the variable names, but I don’t see a problem there.

At a glance I’m not sure what this section is for or why you changed it.

EDIT: also I should point out that I’m assuming your code does actually contain this line at the top although it did not appear in your paste:

I changed the names cause this is modified from my 5-static modes version (plus moonlight) from a different build, when I needed to have more levels than stock it was just easier for me to number them than to make a "med-high/med-low".

I'm having lots of posting issues, I think its cause I'm using the standard mobile editor from my phone and now the advanced editor here and logged in from both at the same time, I am also having issues with quotes not showing up or just showing up as empty boxes. Lets pretend I'm not computer illiterate for a minute lol.

Later today I'm going to build a second Tiny10 FET for testing and load it up with the same code, maybe try adding a gate resistor somewhere (not sure where I'll fit anything else)

You didn’t address what this change was for, do you know?

PWM_LVL = modes[—mode_idx];

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;