Flashlight Firmware Repository

2281 posts / 0 new
Last post
pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

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.

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

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’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

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?

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

pilotdog68 wrote:
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.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 4 weeks ago
Joined: 05/30/2013 - 23:31
Posts: 6422
Location: Held against my will in IOWA, USA

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

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

pilotdog68 wrote:
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?

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/ .

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161
pilotdog68 wrote:
Assuming you don’t have those modes set to a pwm value under ~5, it certainly sounds dual-pwm related.

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.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

18sixfifty wrote:
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.

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.

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

ToyKeeper wrote:
18sixfifty wrote:
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.

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

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

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.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

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

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

Tom E wrote:

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.


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.

chouster
Offline
Last seen: 3 months 1 week ago
Joined: 02/20/2014 - 15:05
Posts: 746
Location: germany

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)…

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

chouster wrote:
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)…

Thanks I might actually switch it so the star isn’t soldered because soldering it doesn’t seem to work.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

Fresh driver and same problems. I am getting three out of four modes now, so I’m closer. But still no moon. I’m using star 1.1

I’m having problems trying to figure out where to change the pwm settings. That has to be it.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

18sixfifty
18sixfifty's picture
Offline
Last seen: 1 year 7 months ago
Joined: 12/25/2012 - 20:19
Posts: 4161

I got it working and I think it was just a combination of me having a case of the dumbspits and possibly bad mcu’s. I ended up using an older driver that I hadn’t used from way back and that along with phase-correct PWM did the trick. I ended up getting the moonlight mode stable at about half of what it was on the original star 1.1 version.

Does anyone have software that will wipe these mcu’s really clean? Maybe I got a batch that was used previously? Can that happen? They came from China instead of Richard, teach me to cheap out.

I’m a junky, I mod lights so I can sell lights so I can buy more light to mod so I can sell lights to buy more lights to mod.

pyro1son
pyro1son's picture
Offline
Last seen: 3 months 3 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

TK, how do you use the ramp_calc.py?
I’t trying to get some new values as I need it to start at 3 and I’d like 64 steps but I don’t know how to use this file.

Pastebin                                      &nbs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

pyro1son wrote:
TK, how do you use the ramp_calc.py?
I’t trying to get some new values as I need it to start at 3 and I’d like 64 steps but I don’t know how to use this file.

I’d suggest using bin/level_calc.py instead… because Ferrero_Rocher/ramp_calc.py is old and less accurate and harder to use, and the only extra thing it offers is pulse frequency modulation to make the low end of the ramp look smoother.

If you aren’t using a single-channel driver with both PWM and PFM, use bin/level_calc.py instead.

For example, a FET+7135 driver with a single XP-L:

(~/src/torches/trunk/)-]> ./bin/level_calc.py
How many total levels do you want? (4) 64
Lowest visible PWM level, for moon mode: (6) 1
How bright is moon mode, in lumens? (0.25) 8
How bright is the highest level, in lumens? (1000) 1500
Use dual PWM? [y/n] (n) y
Second channel, lowest visible PWM level: (6) 3
Second channel, how bright is the lowest mode, in lumens? (0.25) 0.25
Second channel, how bright is maximum, in lumens? (140) 140
1: visually 0.63 (0.25 lm): 0.00/255, 3.00/255
2: visually 0.80 (0.52 lm): 0.00/255, 3.48/255
3: visually 0.97 (0.92 lm): 0.00/255, 4.21/255
...
62: visually 11.10 (1369.01 lm): 208.87/255, 255.00/255
63: visually 11.28 (1433.51 lm): 219.85/255, 255.00/255
64: visually 11.45 (1500.00 lm): 255.00/255, 0.00/255
PWM1/FET  values: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,3,6,9,12,15,18,22,26,30,34,38,43,48,53,58,63,69,75,81,88,95,102,109,117,124,133,141,150,159,168,178,188,198,209,220,255
PWM2/7135 values: 3,3,4,5,7,8,11,14,17,21,26,31,38,45,53,62,72,83,95,109,124,140,157,176,196,218,241,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0
pyro1son
pyro1son's picture
Offline
Last seen: 3 months 3 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

OK how does it work?
I’m only using single channel with 3× 7135

Pastebin                                      &nbs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

pyro1son wrote:
OK how does it work?
I’m only using single channel with 3× 7135

Oh, that should be pretty straightforward then. Smile

Basically just tell it you want 64 levels, minimum PWM of 3, lowest mode of 0.5 lumens, highest mode of 400 lumens, and no dual PWM. It looks like 64 levels will get you a few duplicates at the beginning though. That’s what pulse frequency modulation helps with, but it’s also more than a little finicky and might not be worth the effort.

Are you putting this into an e-switch light with Ferrero_Rocher, or something else?

pyro1son
pyro1son's picture
Offline
Last seen: 3 months 3 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

Yeh it’s an e-switch light using Ferrero_Rocher Ramping UI. Maybe 64 levels might be too much, might just stick with 40. When I try run this I just get syntax errors.

Pastebin                                      &nbs

Halo...
Halo...'s picture
Offline
Last seen: 4 years 10 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

pyro1son wrote:
OK how does it work?
I’m only using single channel with 3× 7135

As in ToyKeeper’s example, you just run level_calc.py and it will ask you questions. Copy and paste the errors are you are getting.
pyro1son
pyro1son's picture
Offline
Last seen: 3 months 3 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

I don’t know how to run it tho.

EDIT: Figured it out thanks!

Pastebin                                      &nbs

Halo...
Halo...'s picture
Offline
Last seen: 4 years 10 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

You’re on windows? You need to have python installed and the level_calc.py script is then run from a command line prompt.

A little windows how-to would be helpful I’m sure. Anyone up for it? I don’t even have a windows pc at the moment. Silly

pyro1son
pyro1son's picture
Offline
Last seen: 3 months 3 days ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

Sure I’ll make a how to next week now that I’ve figured it out.

Pastebin                                      &nbs

s1m888
s1m888's picture
Offline
Last seen: 1 day 13 hours ago
Joined: 07/12/2014 - 02:18
Posts: 181
Location: S. E. Asia

Can anyone help me with this. I have a FET + 7135 driver, i just removed the FET because i want to use one 7135 only. I am using the blf a6 firmware. I thought that i will get a very stable moon mode using only one 7135 but i was wrong. At 4.2v i get around 1 lumen(just my estimate) on moon mode. But at 3.7v i get a very dim moon mode. At 3.6v the moon don’t light up.
Here is my code

// PWM levels for the big circuit (FET or Nx7135)
#define MODESNx1 0,0,0,0
// PWM levels for the small circuit (1×7135)
#define MODES1×1 3,12,42,255
#define MODES_PWM1 FAST,PHASE,PHASE,PHASE

At 3.6v on high mode i can still get 350mA so i don’t know why moon mode doesn’t light up at the same voltage 3.6v.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

Don’t use “FASTPWM mode for moon. Try using PHASE instead, and it should be a lot more stable.

The reason is because the LED takes like 2 to 5 “frames” to visibly light up, depending on voltage. With FAST mode, it’s only powered for 3 out of every 256 frames, and the first 2 to 5 of those frames are dark. After voltage drops low enough to need 4 frames, it won’t light up at all.

With PHASE mode it instead lights for 6 out of every 512 “frames”. So, it still gets dimmer with voltage but even with a nearly-empty cell it should still light up at least a little bit.

I’d suggest using PHASE for moon and turbo, and FAST for every other mode.

s1m888
s1m888's picture
Offline
Last seen: 1 day 13 hours ago
Joined: 07/12/2014 - 02:18
Posts: 181
Location: S. E. Asia

Thanks. I’ll try that.

vestureofblood
vestureofblood's picture
Offline
Last seen: 1 week 4 days ago
Joined: 08/17/2012 - 15:21
Posts: 1980
Location: Missouri

Hi TK,

I am using your Firmware for Ferrero Rocher driver and I was wandering what is the maximum number of ticks I can use for the turbo timer?    I need to be out about 10 min.


EDIT: Also I dont see where to set the turbo low at.    What is the default?

In Him (Jesus Christ) was life; and the life was the light of men. And the light shineth in darkness; and the darkness comprehended it not.
http://asflashlights.com/ Everyday Carry Flashlights, plus Upgrades for Maglite.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 3 days 17 hours ago
Joined: 01/12/2013 - 14:40
Posts: 10654
Location: (469219) 2016 HO3

vestureofblood wrote:

Hi TK,

I am using your Firmware for Ferrero Rocher driver and I was wandering what is the maximum number of ticks I can use for the turbo timer?    I need to be out about 10 min.


EDIT: Also I dont see where to set the turbo low at.    What is the default?


The turbo timer is a 16-bit integer, so the maximum value is 65535 (one less than 2 ** 16). Each “tick” should be about 0.016 seconds. 10 minutes * 60 seconds / 0.016 seconds per tick = 37500 ticks per 10 minutes.

The turbo function in Ferrero_Rocher.c simply steps down one level as if the user had told it to drop one step. So, it should go to the second-highest level.

Pages