Flashlight Firmware Repository

2161 posts / 0 new
Last post
pyro1son
pyro1son's picture
Offline
Last seen: 6 months 1 week ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

ToyKeeper wrote:

That’s because you used fast PWM, which still turns on for about half a clock tick each cycle even at level zero. If you switch that to phase-correct, it shouldn’t turn on the main LED while the second LED is on.

This only happens on the FET channel because the 7135 channel isn’t powerful enough to make the effect visible.

Tweaked the firmware so the second group is low red, high red, low white, high white, beacon and set all the red modes to phase PWM and now only the red lights up! Thanks!

Pastebin                                      &nbs

pilotdog68
pilotdog68's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 05/30/2013 - 23:31
Posts: 6420
Location: Held against my will in IOWA, USA
pyro1son wrote:
ToyKeeper wrote:
That’s because you used fast PWM, which still turns on for about half a clock tick each cycle even at level zero. If you switch that to phase-correct, it shouldn’t turn on the main LED while the second LED is on. O This only happens on the FET channel because the 7135 channel isn’t powerful enough to make the effect visible.

Tweaked the firmware so the second group is low red, high red, low white, high white, beacon and set all the red modes to phase PWM and now only the red lights up! Thanks!

Looks like you and I have been working on similar projects. I should pay closer attention to this thread… TK probably thinks i don’t know how to read…

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

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

guardior wrote:
Your power supply may not be stable on full output. Just to make sure increase the value on line 648 or disable battery monitoring.

Edit: In your code battery monitoring counts 8 ticks which is around 4 seconds.


I Just tried running it straight from a battery and it works perfectly. I’m still a little confused, as my measurements show the power supply holding steady. Either way, the flashlight is working and I’m happy to finally say this project is “done.”

Thanks for the help.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

pilotdog68 wrote:
I Just tried running it straight from a battery and it works perfectly. I’m still a little confused, as my measurements show the power supply holding steady.

I’ve also run into issues sometimes when testing things on a bench PSU instead of using a battery. It’s not usually so bad with lights, but some other hardware can behave pretty strangely with a dedicated power supply.

The PSU I’m using is limited to 5 amps, so high-powered lights hit a hard wall when they try to pull more than that. It’s fine at lower levels though. The really weird stuff only happens when I plug in devices with built-in chargers and other more complex circuits.

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

This is my Convoy/XinTD X3 firmware. It’s nothing that special or difficult, but since TK helped me with it I figured I’d share it here.

blf-A6 was the starting point, but as it sits all the hidden modes and mode reversing are commented out.

It still has the two mode groups.

The first group is for li-on use:

  • 4 modes, moon on the 2nd channel, then L>M>H on the main channel
  • LVP turned on

The second group is for use with the 3*AA carrier:

  • 3 modes, L>M>H all on the 2nd channel (to avoid over-drawing alkalines, ~760ma in my X3)
  • LVP turned off

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

Thanks! The no-LVP-on-AA trick is a good idea. I added it to the collection. Smile

ImA4Wheelr
Offline
Last seen: 3 weeks 4 days ago
Joined: 02/03/2013 - 14:51
Posts: 7918
Location: SC

Thank you ToyKeeper for hosting these shared FW's.

I haven't been keeping up with this area.  Is there a place that has the UI's and operating perimeters of the various FW's and variations?

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

ImA4Wheelr wrote:

Thank you ToyKeeper for hosting these shared FW’s.

I haven’t been keeping up with this area.  Is there a place that has the UI’s and operating perimeters of the various FW’s and variations?


The closest thing is the repository index file, which is mostly intended for searching, not so much for reading. Beyond that, once you’ve found something compatible with your switch type and driver type, it’s mostly a matter of reading the text files included with the matching projects to figure out which ones sound best.
vestureofblood
vestureofblood's picture
Offline
Last seen: 15 hours 4 min ago
Joined: 08/17/2012 - 15:21
Posts: 1840
Location: Missouri

+1 ToyKeeper.   Thank you for setting up the repository, and for the assistance you have provide in this thread.

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.

jhalb
jhalb's picture
Offline
Last seen: 2 years 8 months ago
Joined: 03/23/2015 - 21:24
Posts: 1350
Location: California

+1!!

n10sivern
n10sivern's picture
Offline
Last seen: 1 day 1 hour ago
Joined: 11/09/2014 - 21:37
Posts: 1520
Location: biloxi, ms

ugh, I’m so lost with this. I have everything (i think) that I need to flash, but I am lost. I’ve read this thread and the Star Firmware thread and it is info overload!!! can somebody point me in the right direction to a firmware that is a single mode 100% with LVP step-down. I saw one at the repository by toykeeper, but i’m not sure of the specifics as to what it does for LVP and at war voltage.

Three tomatoes are walking down the street- a poppa tomato, a momma tomato, and a little baby tomato. Baby tomato starts lagging behind. Poppa tomato gets angry, goes over to the baby tomato, and smooches him… and says, Catch up.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

n10sivern wrote:
ugh, I’m so lost with this. I have everything (i think) that I need to flash, but I am lost. I’ve read this thread and the Star Firmware thread and it is info overload!!! can somebody point me in the right direction to a firmware that is a single mode 100% with LVP step-down. I saw one at the repository by toykeeper, but i’m not sure of the specifics as to what it does for LVP and at war voltage.

The only one I’m aware of is STAR_1mode.

From what I recall, it starts at max output, steps down gradually to a bit over half when it hits the turbo timeout, then stays at that level until voltage gets low. It then drops output by half each time the voltage gets too low, until it’s barely on, and then it finally shuts off.

The code is a little weird since it’s based on STAR and I changed as little as I could, so a lot of the code is unnecessary for only one mode. I should probably trim out the extra parts some time…

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

Question! Does the BLF-A6 firmware have mode memory? Mine all seem to default to the first mode.

Pastebin                                      &nbs

n10sivern
n10sivern's picture
Offline
Last seen: 1 day 1 hour ago
Joined: 11/09/2014 - 21:37
Posts: 1520
Location: biloxi, ms

ToyKeeper wrote:
n10sivern wrote:
ugh, I’m so lost with this. I have everything (i think) that I need to flash, but I am lost. I’ve read this thread and the Star Firmware thread and it is info overload!!! can somebody point me in the right direction to a firmware that is a single mode 100% with LVP step-down. I saw one at the repository by toykeeper, but i’m not sure of the specifics as to what it does for LVP and at war voltage.

The only one I’m aware of is STAR_1mode.

From what I recall, it starts at max output, steps down gradually to a bit over half when it hits the turbo timeout, then stays at that level until voltage gets low. It then drops output by half each time the voltage gets too low, until it’s barely on, and then it finally shuts off.

The code is a little weird since it’s based on STAR and I changed as little as I could, so a lot of the code is unnecessary for only one mode. I should probably trim out the extra parts some time…

Would it be easy to take out the excess and leave it at 100% until the LVP?

Three tomatoes are walking down the street- a poppa tomato, a momma tomato, and a little baby tomato. Baby tomato starts lagging behind. Poppa tomato gets angry, goes over to the baby tomato, and smooches him… and says, Catch up.

_the_
_the_'s picture
Offline
Last seen: 1 week 2 days ago
Joined: 07/08/2011 - 06:22
Posts: 3633
Location: Finland

n10sivern wrote:
Would it be easy to take out the excess and leave it at 100% until the LVP?

Yes, very easy. Just uncomment the definition of MODE_HIGH and comment out the definition of MODE_TURBO, like this:

//#define MODE_HIGH 255 // Can comment out to remove mode
#define MODE_TURBO 255 // Can comment out to remove mode

=>

#define MODE_HIGH 255 // Can comment out to remove mode
//#define MODE_TURBO 255 // Can comment out to remove mode

=the=

 

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

pyro1son wrote:
Question! Does the BLF-A6 firmware have mode memory? Mine all seem to default to the first mode.

it is user-configurable. It can be set to be toggled by soldering a star, or by a soft-toggle (the same way you change mode groups). By default, it starts out no-memory.

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

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

I’m in need of help for a new-ish UI (unless somebody already has one that would work.) It is for an LEO, he wants a dual-switch light (traditional click-switch + e-switch). I just don’t know where to start. Is STAR dual-switch the best jumping point?

  • Main power button is only on/off
  • e-switch changes modes
  • single click to cycle L>M>H
  • 0.75sec hold to access fast strobe
  • single click from strobe to access slow beacon
  • 0.75sec hold to return to main loop
  • Mode memory for all modes
  • LVP protection

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

guardior
Offline
Last seen: 1 day 20 hours ago
Joined: 04/06/2015 - 14:06
Posts: 132
Location: Sweden

n10sivern wrote:
ugh, I’m so lost with this. I have everything (i think) that I need to flash, but I am lost. I’ve read this thread and the Star Firmware thread and it is info overload!!! can somebody point me in the right direction to a firmware that is a single mode 100% with LVP step-down. I saw one at the repository by toykeeper, but i’m not sure of the specifics as to what it does for LVP and at war voltage.

If you’re only using single pwm output you can use a firmware I wrote a while back. It’s very easy to use and only got pre set values.

https://github.com/xerxes2/flashlight-firmware/tree/master/tacdrv

If you don’t touch anything outside of Start/End user tweaking I don’t think you can mess up this one.

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

Ahhhh I’m also not using the latest version. I’ll update my firmware.

Pastebin                                      &nbs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

pyro1son wrote:
Question! Does the BLF-A6 firmware have mode memory? Mine all seem to default to the first mode.

Yes, and by default you can toggle mode memory by entering config mode then turning it off between the second two blinks. Here’s a visual summary of the default interface:
ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

pilotdog68 wrote:
I’m in need of help for a new-ish UI (unless somebody already has one that would work.) It is for an LEO, he wants a dual-switch light (traditional click-switch + e-switch). I just don’t know where to start. Is STAR dual-switch the best jumping point?
  • Main power button is only on/off
  • e-switch changes modes
  • single click to cycle L>M>H
  • 0.75sec hold to access fast strobe
  • single click from strobe to access slow beacon
  • 0.75sec hold to return to main loop
  • Mode memory for all modes
  • LVP protection

STAR dual-switch is probably the best starting point. I haven’t attempted to make a dual-switch firmware, and I’m not aware of many which already exist. However, you’ll probably need to change a fair amount of the code to get the features you described.

If you don’t mind it resetting to the first mode each time, any e-switch firmware can be used on a dual-switch light. However, I doubt that’s desirable for what you described.

At first, I thought LEO meant “low earth orbit”. Smile

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

It shouldn’t be too difficult to add “memory” to an e-switch firmware, should it?

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

pilotdog68 wrote:
It shouldn’t be too difficult to add “memory” to an e-switch firmware, should it?

I think the memory parts should be relatively easy; mostly just copy and paste some code from other projects. It’s the UI changes which pose more of a challenge. E-switches need considerably more UI code than clicky switches.
pilotdog68
pilotdog68's picture
Offline
Last seen: 3 weeks 6 days ago
Joined: 05/30/2013 - 23:31
Posts: 6420
Location: Held against my will in IOWA, USA

If I skip the Beacon part it should be easy. Just start with STAR Momentary, add the memory bit, and change long press to mean strobe instead of reverse mode

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

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ImA4Wheelr
Offline
Last seen: 3 weeks 4 days ago
Joined: 02/03/2013 - 14:51
Posts: 7918
Location: SC

ToyKeeper wrote:

ImA4Wheelr wrote:

Thank you ToyKeeper for hosting these shared FW’s.

I haven’t been keeping up with this area.  Is there a place that has the UI’s and operating perimeters of the various FW’s and variations?


The closest thing is the repository index file, which is mostly intended for searching, not so much for reading. Beyond that, once you’ve found something compatible with your switch type and driver type, it’s mostly a matter of reading the text files included with the matching projects to figure out which ones sound best.

Thank you for that info.  Smile

vestureofblood
vestureofblood's picture
Offline
Last seen: 15 hours 4 min ago
Joined: 08/17/2012 - 15:21
Posts: 1840
Location: Missouri

Hey all,

Is there any way to program the generic micros that look the same as the Atiny13A?    I have seen these on some drivers before, but not ever tried to program one.

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: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

A generic SOIC8 chip could be anything. Attiny13 is only one of many chips which look like that, and each one works differently. The details probably vary for each type of chip.

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

I’ve updated my firmware and selected;

Quote:
// comment out to use extended config mode instead of a solderable star // (controls whether mode memory is on the star or if it’s a setting in config mode) #define CONFIG_STARS

Which should give me mode memory? Correct? But I still don’t seem to have it. I’m using a zener modded board could this be affecting it?

Also when I start again it gives me my lowest mode. Even in the second group it gives me my lowest of the first. It starts with the lowest of second group then after a second goes to lowest of first group then I can cycle through the modes on the second group like normal.

Pastebin                                      &nbs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 8 hours 6 min ago
Joined: 01/12/2013 - 14:40
Posts: 10107
Location: (469219) 2016 HO3

pyro1son wrote:
I’ve updated my firmware and selected;
Quote:
// comment out to use extended config mode instead of a solderable star // (controls whether mode memory is on the star or if it’s a setting in config mode) #define CONFIG_STARS

Which should give me mode memory? Correct?

No, that only controls how that option gets configured. With CONFIG_STARS defined, you can enable mode memory by grounding pin 3. With it not defined, you can enable mode memory by pressing the switch a bunch of times and then turning it off between the second set of two blinks. Neither method turns it on by default.

If you want mode memory hardcoded as on, you’ll need to change some other part of the sources, or use tk-otc.c (which drops the config mode entirely in favor of hard-coding options, but provides more space to add features).

chouster
Offline
Last seen: 1 week 2 days ago
Joined: 02/20/2014 - 15:05
Posts: 690
Location: germany

Yesterday I flashed my first driver (stacked 105C, 12×7135) with the S7 firmware, worked fine, very nice firmware. I used the ready to use .hex-file.

Today I wanted to try star_noinit. Therefore I had to create a hex file. I have to say I’m a total newbie to all of this flashing/coding stuff.

I have Atmel Studio 6.2 installed. Finally I’ve been able to get a hex file, but it’s 2685 bytes.

The way I did it was: file->new->project-> GCC C Executable->ATtiny13A, then deleted that automatically created stuff, copied and pasted in the code, ->project->(filename)properties->toolchain->Optimization(under AVR/GNU C Compiler)->optimize for size (-Os), then build->build solution

I just installed AS6.2 without making any changes to whatever settings.

Help would be appreciated. Thanks.

Pages