Flashlight Firmware Repository

Hi TK,

I decided to take your advice about using the FET + 7135 driver to get the super low mode I want with an XHP setup ( parts are on the way)

What I am wandering now is will I be able to tweak the Star_off_time code to get what I want out of that?

I see that there is a line of code there to enable a second PWM ( line 86)

//#define DUAL_PWM_START 8 // Above what output level should we switch from the alternate PWM output to both PWM outputs?

What else would I need to do to get this rolling with the dual?

Not sure what you and TK talked about, but that’s all that’s needed.

As it sits, and modes under pwm level 8 will use the 7135 channel only, and anything above 8 will use both the 7135 and the FET. (you’ll need to un-comment it [remove the // ])

Is that what you were asking?

^ I think 255 is FET only too with the "stock" code.

EDIT: Sorry, my above response is incorrect. I was thinking about Phase vs Fast. Phase being used for the first and highest modes.

To get it into the main loop, add “STROBE” or 253 to the main channel in one of the two mode groups, and make the other entries longer too. For example, adding it to the end of the second mode group:

#define NUM_MODES2 5
#define MODESNx2 0,0,79,255,STROBE
#define MODES1x2 20,200,255,0,0
#define MODES_PWM2 FAST,FAST,FAST,PHASE,PHASE

I think that looks about right, but I haven’t tried it.

FWIW, I haven’t tried a single 7135 chip on a XHP or MT-G2 or other higher-voltage higher-output emitter. I’m not sure what to expect from it.

As for tweaking Star_off_time, any code can be modified to do pretty much anything. It depends on how much you’re willing to modify it.

By default, Star_off_time uses the same PWM level for both the FET and the 7135 simultaneously, unless the level is below the threshold you quoted above. In that case, it’ll use only the 7135 by itself. Tying the two together makes it simple, but it also means you have less control over each channel individually — it won’t let you ramp up the 7135 alone then turn on the FET only when needed; instead the 7135 and FET will both be active and have a fixed ratio of how much power each one contributes to the whole.

However, if you were going to have a lot of mode groups, the joint-PWM approach only needs to store one number instead of two, so it cuts the storage needs in half.

I just built a quick dual channel driver using an old DD only driver. Loaded it with BLF-A6 unmodified. It doesn't do anything but Moon Light Mode with the OTC in place. It works fine without the OTC in place.

Is that the way this FW is supposed to work stock?

Nope.

Sounds like the OTC calibration is way off. You can get OTC values by flashing battcheck/offtime-cap.hex and then pressing the button for the length of time you want it to use. It should then blink out the OTC value for that amount of time, which can be plugged back into other firmwares. Similar story for voltage calibration, only using battcheck.hex instead.

^ Thank you TK. You must have one of the deepest knowledge bases on BLF in that brain of yours.

Unfortunately, my mod put an AMC7135 on top of the MCU with some wires. Now that I know the QTC is required, I'll first investigate the 1uf Cap. Maybe it was shorted or something. If that doesn't fix the issue, I'll follow your above advice.

Much appreciated :)

Maybe it’s just me, but one of my modding rules is to always make sure the MCU will be accessible (with no extra pins grounded) so I can reflash it later. I reflash pretty much everything from time to time, and I generally expect that I’ll need to flash each one a few times to get the calibration right. There’s always something a little off, whether it’s the PWM level for moon or the OTC timings or the voltage levels or … whatever.

^ That's a very good rule. I just didn't want to wait for the OSH Park DD +7135 boards to arrive. No matter what, I had to solder a wire to at least one of the MCU pins and it was late last night. But you have me thinking that I need to move the 7135 over to the top of the FET.

I have to give you a huge thumbs up TK. I just read much of the parts of this thread that deal with BLF-A6. Wow! Really impressive all the functionality and performance. And that UI diagram. I absolutely love that. It really helped me understand the UI. And what an impressive UI it is. Really excited about this new direction wight and you have opened up. Thank you.

Hey all,

Is there a way to power more than one LED separately using an FET driver and code.

What I mean is this. I am working on a head lamp for a guy that has the one main led that is white. And another LED that is red. His setup now is manual through a multi poll switch and a pile of resistors. Is it possible to get both LEDs included using a momentary switch and FET driver?

Thanks

For two channels of output w/ATTiny13A, yes - we do that now with the FET+1 7135 drivers, accept the 7135 output goes to the same LED+ pad as the FET -- if you separate those outputs, they can drive 2 different LED's. For a 3rd channel, little more tricky - actually I don't think you can PWM on a 3rd channel, but for the 2 channels the FET+1 drivers support, PWM's work great per channel. For 3 PWM outputs, I believe the PIC MCU's are a better choice, as C_K used.

So, you could driver 2 banks of 7135's, or 2 FET's, or the combo as the stock BLF wight FET+1 drivers do. It's all a matter of wiring the outputs.

Hope someone can confirm or clarify this - think I'm wight right Smile.

You’re right. A few people have done it, including myself. Wight even made a driver specifically for driving white and secondary red led’s. (although that driver is a royal pain)

Update on the problem I mentioned about. Got it working better, but still weird by doing the following (I don't know which change mattered):

  • Used a different new 1uf Cap
  • Relocated the 7135 to the top of the FET
  • Removed the solder to ground on Star 3

Now I can go up through the modes, but not down. It always goes into configuration mode when I switch connect the cell. Meaning, I connect the cell, there is a delay, then the 2 short flashes for 7/4 mode groups, another pause, then the 2 flashes for memory, another pause, then moonlight mode turns on. I can click between the first 2 flashes to pick the other mode group and that works. I can't seem to get memory to work.

I'll try to run battcheck/offtime-cap.hex as TK recommended sometime soon, but reported the above in case it means something to anyone.

That sounds annoying to deal with.

The only way it should be able to enter config mode is if the OTC reads out a short press and the “fast_presses” value has its 0x10 bit set. This shouldn’t happen on “first boot” unless your OTC values are way, way off and you’re unlucky enough to have the RAM decayed into an unfavorable state.

You might want to try uncommenting this line and rebuilding:
if (fast_presses > 0x20) { fast_presses = 0; }

This will make it reset the counter if it appears to have decayed, which should prevent the immediate config mode. However, you’ll still need to fix the OTC if you want to access hidden modes or be able to move backward.

It sounds like your OTC must be always reading 255 no matter how long it has been off. This is likely a hardware problem, not just a matter of calibrating the software. This issue would also interfere with the mode memory function, since that’s only used on a long press (and it seems you can only get short presses).

In case you have trouble building it, I put up a custom build here:
http://toykeeper.net/torches/blf-a6/otc-fail-workaround.hex

^ I'm leaning towards hardware problem too. I probably won't get a chance to work on the driver until this weekend. I'll follow your advice and report back hopefully this weekend.

Thanks again for taking the time to share your thoughts on matter. :)

EDIT: It just occurred to me that I tested the driver (in all cases) right after doing solder work (including soldering the OTC). So the driver was probably quite warm. I understand from some the posts that temp is currently presenting a challenge with this driver/FW. I will try the driver out again tonight while it is normal room temp.

I second that! Results are amazing, but the work is a nightmare

Got a link for this driver? Not familiar with it (thought I knew all the wight drivers -- big fan!).

Ooops, here for the 2 output driver board: https://budgetlightforum.com/t/-/31956

Just starting to get back to modding after I had my shoulder operated on and trying to catch up. Wow you guys move fast.!!

Anyone have a VERY basic program with a hidden strobe, like a minidvr with strobe? How about something simple that starts on high? I see the one that can start on high set up for “stars” but I’m talking about something for a basic FET driver.

I don't have anything very basic... Smile

I got a somewhat hidden strobe in a e-switch driver: click for ON to 1st mode or next mode, hold for prev mode, long hold for strobe. Once a mode is set for ~1.2 secs, next click turns the light OFF. My favorite modes for this driver is 5, including a moonlight as the 1st.