Flashlight Firmware Repository

2241 posts / 0 new
Last post
Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

Something like this:

if (++mode_idx == (sizeof(modes) - 2))

   ++mode_idx;

if (mode_idx >= sizeof(modes))

...

...

 

Ok - you'd be adding the first 2 lines, and modding the 3rd line to remove the ++. This is all in the function: next_mode().

Hope I made this clear enough. Basically you detect if the mode is incrementing to the 2nd highest mode. If so, increment the mode index again.

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

I think I have everything working now. I haven’t actually tested LVP yet, but I don’t know why it wouldn’t work as the mode order is now back to “normal”.

Would one of you mind looking over it to make sure there isn’t some hidden screw-up that will cause me grief later? thanks

once again, mine is on the right, stock STAR is the left.
Diff check

edit: JK, now I’m back to having the problem that when power is cycled when in mode “0” it doesn’t come on in mode “3”. Sad
plot twist: So if I hold the button for 2.5 seconds it enters mode “0” (off). If I then remove power for 5 seconds before reapplying, it comes on in mode “3” as it should. Any ideas here?

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

There's something that's keeping power goin for 5 secs - no other explanation I can think of. Cap? Something?

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

Oops, forgot to update here.

That issue was on my “power supply.” I decided it wasn’t a big deal, so I installed it in the light anyways. Miracle of miracles, once in the light that weird behavior went away.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

U mean a bench PS? Ohhh - if so, would explain the 5 secs shutdown... My bench PS is super slow on shutting down.

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

FWIW, I did some tests a while ago for the mem-decay method of detecting short presses. If I drain the OTC, it seems to take about 0.5s for the memory to decay. If I leave the OTC fully charged, it seems to take about 4s for memory to decay.

Just a thought. I don’t even know if you’re using that method.

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

Tom E wrote:

U mean a bench PS? Ohhh – if so, would explain the 5 secs shutdown… My bench PS is super slow on shutting down.


It’s actually just a cheap buck converter I use to test drivers, but I have a omten switch in series anyways.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

Hhhmmm. Something wasn't right bout that setup I guess? if it worked once in the light.

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

Tom E wrote:

Hhhmmm. Something wasn’t right bout that setup I guess? if it worked once in the light.


I’ve had other issues with it before, especially with turbo timers. Idk if it’s ripple or what.

For instance on this driver, I have the timer set to 2 minutes. Its 6*7135 (2.3amps). If I have my buck converter limited to a lower output, like 1.5amps, the turbo timer steps down wayyyy early, like 1 minute instead of 2. But if I don’t limit output on the “power supply”, the timer works just fine.

I don’t understand it, but I’m slowly learning that if something isn’t acting the way the firmware says it should, try it on a battery before freaking out.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

I do my initial tests on a batt 90% of the time - an old TrustFire in a holder w/red&black wires ended with alligator clips. Sometimes if it's more risky, I'll go slowly up with the bench PS. I'm usually carefully continuity testing everything out first, so not much risk applying power.

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

Oh, on a variable current / voltage power supply, with current limited, the voltage can do some weird things. You can only limit one or the other, basically, and the other will adjust itself accordingly.

I’ve been finding that even voltage calibration seems to work better with a battery than with a power supply (and a DMM to confirm voltage in real time).

Mitko
Mitko's picture
Offline
Last seen: 7 months 3 weeks ago
Joined: 09/19/2014 - 05:20
Posts: 1537
Location: Bulgaria

Do we have a Yezl Y3 Star firmware – el switch and a tail switch, several modes switched through the el switch and an offtime memory?

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

Mitko wrote:
Do we have a Yezl Y3 Star firmware - el switch and a tail switch, several modes switched through the el switch and an offtime memory?

I do. On the 25/45/85 thread, have a dnld link but it requires a 45 or 85. Blew past 2KB code, so the 25 won't cut it. It's also fully programmable (64 possible mode combos) and I posted an instruction manual (2 pages) on it's operation. Didn't upgrade a Y3 yet, but I'll have to do 4 of them shortly. Have the dual switch (e-switch/power) version dnld'ed in a X6R and works well so far.

Mitko
Mitko's picture
Offline
Last seen: 7 months 3 weeks ago
Joined: 09/19/2014 - 05:20
Posts: 1537
Location: Bulgaria

Great, but can it be applied on wight`s A17dd ver 0.44 and tinny13? The last Y3 i modded was with that driver, el and tail switch and TK Ramping UI table firmware, V6 1D dedomed and 210k cds, came out exellent but now i need the firmware i mentioned

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

No tiny13 support, only a 45 or 85 on a FET+1 driver. I've only used the FET+1 wight drivers, like the BLF A6 driver, in 17 and 22 mm sizes. All my e-switch build/mods are or will be 85 based. It can be changed to work with a conventional FET or 7135 (only) driver but I don't see it worth the effort for now. There are some newer OSHPark boards available now for the larger footprint of the 45/85, but mostly I'm doing the "bent in pin" technique to retrofit.

Mitko
Mitko's picture
Offline
Last seen: 7 months 3 weeks ago
Joined: 09/19/2014 - 05:20
Posts: 1537
Location: Bulgaria

thanks, fet+1 will do fine too, have to start trying 85 out now Wink

chouster
Online
Last seen: 1 min 53 sec ago
Joined: 02/20/2014 - 15:05
Posts: 694
Location: germany

Hi,

I’m thinking about giving bistro a try. I have components for wight’s 17mm FET+7135 and I recently ordered an Attiny 25. Unfortunately I got the normal 25, not 25V. Would I have to make some important changes to the code for the use of the “standard” 25?

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

chouster wrote:
Hi, I'm thinking about giving bistro a try. I have components for wight's 17mm FET+7135 and I recently ordered an Attiny 25. Unfortunately I got the normal 25, not 25V. Would I have to make some important changes to the code for the use of the "standard" 25?

Nope, no changes. In fact Richard at MtnE sells the 25, not the 25V. Only difference is low operating voltage, but the LVP kciks in before you should get that low anyway.

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

It should work on a non-V model. That’s actually what I used to write it.

chouster
Online
Last seen: 1 min 53 sec ago
Joined: 02/20/2014 - 15:05
Posts: 694
Location: germany

Thanks Tom and TK. I will give it a try. I succeeded in flashing all different kinds of firmware from TK’s repository, but now I’ll have to find out how to work with these new *.h files. Will do some research now. If I think that’s over my head, I could just use the bistro.hex file, right?

edit: ok, I think I found out how to deal with these header files.

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

The headers are something I’m still deciding how best to set up.

Originally, I told the code to include “../foo.h” so it would automatically look in the right place. But that makes it not work when all the sources are copied to a single directory, or when a project is one layer deeper. To fix that, I can include “foo.h” without the .. for parent directory, but the build options will then need a “-I..” to add the parent to the default include path. Maybe a “-I../..” too. Simple fix on a command line, but it means one more step when using AVRstudio.

It’s weird trying to support foreign build systems. Normal software doesn’t have these issues. Normally you’d ship a Makefile and force everyone to build in the same way, but AVRstudio doesn’t like that approach. As builds get more complex though, it gets harder to build with different tools. So I’ve tried to keep it pretty simple, but duplicating code all the time feels like scratching a chalk board.

chouster
Online
Last seen: 1 min 53 sec ago
Joined: 02/20/2014 - 15:05
Posts: 694
Location: germany

@ TK and other awesome people

Ok, most of what you’re saying might be over my head, don’t even know what that foo.h is. I really don’t understand much of programming and flashing, and I wouldn’t be able to flash my drivers if there wasn’t some good tutorials here at BLF. My workflow is: compiling the code with Atmel Studio and than flashing the .hex-file with avrdude via command line, just like in hoop’s tutorial.

Now with your new headers, it’s not that hard to do it, in fact it’s easy once you know how it works. I just right-clicked the project in the solution explorer at Atmel Studio->add->existing file, search for the directory, chose the file, click add. That’s what I did with all the headers that need to be included.

Another change from the way it is in hoop’s tutorial, quite important for someone inexperienced like me, is, because we’re using Attiny25 now, I had to adjust the command lines. t25 instead of t13 and other fuses.

test:
avrdude -p t25 -c usbasp -n

erase:
avrdude -p t25 -c usbasp -u -e

flash bistro:
avrdude -p t25 -c usbasp -u -Uflash:w:bistro.hex:a -Ulfuse:w:0xd2:m -Uhfuse:w:0xde:m -Uefuse:w:0xff:m

I know it’s really basic stuff for people like you or Tom…

When I found out how to do the above, compiling and flashing went just fine.

But it’s not my day today, hand-soldered the A17-HybridS, flashed it (wanted to check if firmware and driver are running as they should and do calibration afterwards), however, ruined a Convoy C8 then, because I destroyed the driver retaining threads. By the way the Convoy C8 has one of the worst driver retaining rings I’ve come across, really crappy. As if that wan’t enough my 60W soldering iron flew of the bench and in a really stupid reflex I caught it, ouch, that hurt, still does. Should’ve stopped there. But wanted to test out this awesome firmware. With the C8 ruined, I went ahead and grabbed a EE X6, thought something like “yeah, feels more like quality” and installed the driver. Works, but first mode doesn’t. Maybe too low of a value for the LED to light up?

I haven’t even read how the UI works and all, but one thing I noticed in an instant: it has soft transitions between modes and I LOVE THAT! This is something I’ve dreamed about for quite a while now. That is just awesome, you, TK, are just awesome!

No more typing for me, my hand really hurts…

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

Thanks for the tips chouster. I follow the same process as you, so I’ll probably reference this post when I get around to using the bigger mcu’s

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

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

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:

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

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

ToyKeeper wrote:
To fix that, I can include “foo.h” without the .. for parent directory, but the build options will then need a “-I..” to add the parent to the default include path.

I liked that change. Noticed it shortly after you added it but neglected to comment.
Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

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.

Jaimelito
Offline
Last seen: 2 years 4 weeks ago
Joined: 05/06/2015 - 10:08
Posts: 26
Location: Jerez de la Frontera, SPAIN

hi there.

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

And what is the mcu an LPC1343 ?

Tom E
Tom E's picture
Online
Last seen: 14 min 34 sec ago
Joined: 08/19/2012 - 08:23
Posts: 13593
Location: LI NY

Jaimelito wrote:
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: http://budgetlightforum.com/node/34812 and here: http://budgetlightforum.com/node/39824. It's a product like other products we buy, but also he contributes to the forum and seems to have good support.

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

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?

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 1 month ago
Joined: 12/25/2012 - 20:19
Posts: 4161

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?

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.

Pages