Flashlight Firmware Repository

The lowest mode is probably just too low for the hardware it’s running on. I’ve seen anything from 1 to 9 as the lowest effective PWM level, and it varies depending on the exact type of 7135 chip, the emitter, the battery voltage, etc.

Things aren’t going so well for me today either. I’ve managed to fry and replace a 7135 chip, and the new one needs a higher moon mode. I accidentally flowed a FET right off a board, burned myself three times, made a mess of flux, keep breaking things, and can’t seem to get anything to flash today… except for a bright emitter flash followed by an unexpected moon mode.

I feel a bit like this dude now:

Reflex catch…. Oww :weary: I’ve had that impulse to catch falling hot objects.

I liked that change. Noticed it shortly after you added it but neglected to comment.

For my e-switch 45/85 version, I provide the whole set of files, all folders, all headers, ZIP'ed up, 100% ready to be built using Atmel Studio 7.0. Its easy - one UNZIP. I'm using all or most of TK's header files. I hope you (TK) don't change it. I understand not everyone uses Atmel Studio 7.0 for Windoze, but it is probably the most popular development environment.

hi there.

Is the LD-1 or LD-2 firmware open to public??

And what is the mcu an LPC1343 ?

Unless something has changed, definitely not public. led4power explained why in a lot of detail early on when I asked, but basically he would like compensation for the time/effort - can't blame him at all for that. Not sure bout the MCU, but pics show the MCU's marking, like here: https://budgetlightforum.com/t/-/29463 and here: https://budgetlightforum.com/t/-/33825. It's a product like other products we buy, but also he contributes to the forum and seems to have good support.

Am I crazy, or is there a spreadsheet or tool I can use in conjunction with battcheck that calculates the ADC values for me? Like I plug in the ADC values that battcheck reads out for 4.2v, 4v, and 3.7v, and it will spit out the ADC values for 2.9v or 3.1v?

Howdy, everyone.

I’m pulling my hair out trying to program a nanjg driver.

It doesn’t seem to matter what I do but I can’t get the low modes to work at all. It just skips them no matter what firmware I’m using. Do I need to change the caps or something?

This is for a fellow member who is taking the light on a trip with him and it’s really important that I get it right.

This is what he wants on the light.

20ma, 60 ma, 160ma, 750 ma, 3 amp turbo with memory.

I’m trying to start with a simple 3 amp nanjg. I put an new atiny13a on it but nothing is working on the low modes.

Any ideas?

What firmwares have you tried? If you are using programs that use dual-pwm (like most of the newer FW’s), the lower modes won’t light because the nanjg just has a single pwm channel.

I tried a few different ones and then tried to turn off the dual PWM. I tried the Dr Jones Mini too thinking that one would at least get me into the lower range.

Any suggestions for an older firmware that might work for me? Doesn’t have to be exact I can play around with it.

I would try one of the old versions of STAR that never had dual-pwm just to be sure that wasn’t it.

Can you clarify exactly how it’s behaving?

Ok I’ll give that a shot.

What it’s doing is just ignoring the low modes. So when I put current on, there is Nothing, Nothing, Medium, High. So if it’s four modes I have to click past the first two modes because there is no light in the first two modes.

Assuming you don’t have those modes set to a pwm value under ~5, it certainly sounds dual-pwm related.

Yes. If you can run python scripts, battcheck.py can calculate the ADC values for you. It just needs an input file with two measurements, one for a full (ish) battery and one for an empty (ish) battery. It will then calculate other values based on a linear model.

For example:

(~/src/torches/trunk/ToyKeeper/battcheck/)-]> ./battcheck.py readings/tk-s7.volts 
Line: 179 - 4.09V
Line: 136 - 3.15V
#define ADC_44     193
#define ADC_43     189
#define ADC_42     184
...
#define ADC_22     93
#define ADC_21     88
#define ADC_20     83

I’m also adding this info to a README file in battcheck/ .

I did go in and set the pwm higher and I still had the same problem. Toykeeper suggested that in a PM.

Whats a good single pwm firmware?

I still can’t get over the idea that I’m just missing something really simple.

What pilotdog68 said.

Also, one project you might find works well on a nanjg driver is STAR-noinit. It gives off-time memory without needing an off-time capacitor. Just make sure it has DUAL_PWM_START commented out.

For a sanity check, you might also want to try flashing NLITE.

Thanks. I have the NLITE someplace and I’ll try the STAR-noinit.

Off to work I go, again! :wink:

Ran the Nlite as it was in my hex file and now I’m getting one with nothing and then medium and high. So still no low.

That’s pretty strange. If NLITE doesn’t work, I suspect a hardware issue.

BTW, should I wait for you to get this into a code repository, or should I go ahead and add it from the zip file?

IIRC, you’re familiar with git… and that would totally work. It’s easy to import from git, and eases the process of merging updates later. I already do that for JonnyC’s code (though he hasn’t updated in quite a while).

I think I still have some of your older code waiting in a half-merged state too. Oops. IIRC, there were a whole bunch of formatting changes and relatively few functional changes, and I was trying to untangle those into two separate commits for clarity… but perhaps I should go ahead and dump them all in at once instead. It’s just hard to diff the original and modified versions when virtually every line has changed in ways which don’t affect the actual code function.

TK, I forgot to thank you for a great laugh I had, when I saw the video you posted of that funny dude, didn’t know that one.

@18sixfifty
About the moon mode issue:

I think NLite and Starnoinit, need a star to be soldered to enable moon mode. Of course you could adjust it so that it’d be the other way around (moon enabled by default without the star soldered)…