Flashlight Firmware Repository

2239 posts / 0 new
Last post
vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri

Awesome, thats just what I need.       Is there any option on this firmware for a linear ramp down from turbo to high vs the drop ( like in star firmware)?

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: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

vestureofblood wrote:
Is there any option on this firmware for a linear ramp down from turbo to high vs the drop ( like in star firmware)?

Nope. But if you want a ramping interface you could use Ramping_UI_table.c instead.
vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri


I think a ramp UI would be a bit much for this project.       Are you aware of any e-switch UIs that do have the smooth drop from turbo to high?

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: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

Offhand, I can’t think of any… but I might be forgetting something.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

It's certainly do-able to ramp down smoothly - haven't thought of implementing mine that way though. You could just do the math - how fast you want the transition done, and how many levels it takes. I usually setup a med mode (next mode down from turbo) to be in the 35-40% range. 255 down to 35-40%, is 255 down to 102 (40%) is 153 steps, so if you want it done in ~2 secs, it's 1 step down every 13 msecs. Well, our timer interrupts are 16 msecs, so, 1 step per interrupt is: 2.45 secs.

That ramping would be pretty easy to implement. For 35%, it would take 2.66 secs.


vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri

Tom E wrote:

It's certainly do-able to ramp down smoothly - haven't thought of implementing mine that way though. You could just do the math - how fast you want the transition done, and how many levels it takes. I usually setup a med mode (next mode down from turbo) to be in the 35-40% range. 255 down to 35-40%, is 255 down to 102 (40%) is 153 steps, so if you want it done in ~2 secs, it's 1 step down every 13 msecs. Well, our timer interrupts are 16 msecs, so, 1 step per interrupt is: 2.45 secs.

That ramping would be pretty easy to implement. For 35%, it would take 2.66 secs.



Easy for smarty pants like Tom E and TK maybe Smile    For VOB, well.....?    


I use both your UI and TKs in my personal lights.   For hand held I like yours for the one click off, and I use TKs Ferro in my headlamp.     The light I am building now is a head lamp, but its for someone else and it gets hot fast on turbo.    I set the timer, but when it kicks down to the next lower mode it just feels like a crash.    I am afraid that if I give it to him like this he is going to feel let down or as if something is wrong.

Ideally I would like the drop to take more like 15 seconds.      If implementing this is something you think you can explain to a noob I am all ears.

If not I'm sure I could scare up some candy in my shop for a little trade actionInnocent.

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Ahhh - I'm using the Ferrero Rocher in my F6, and contemplating using it in a couple of swm C20C's I bought as well, since the driver fits in perfect and has the window built-in already. The C20C is just a little better, more compact version of the F6. Like it for not having that darn SS tail plug that is a PIA for modding the tail spring, and the tail spring is uncoated steel - ugh. The C20C was a great deal at $30 but Illumn sold them out - I was able to get 3, very moddable just like the F6's. I probably contributed to them selling out with my blabbing bout them Smile.

Hhmm - hate to commit to anything at this point, but if you have some time, I'd probably get to it. Stretching it out would be pretty easy as well, and would be a nice feature. Dunno if it can fit in 1K for a 13A though - might need a Tiny25. I'd have to see...

vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri

Whenever is fine.     I does not have to be quite that long, but I would need it to be in the 13A so I will take whatever fits in that.   just let me know.   PS: Not kidding about something in trade if you like Smile

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

K, I'll look into it.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

If the realtime battery status LEDs are turned off, there should definitely be room to add a slow turbo ramp-down.

It has been quite a while since I touched any of that code, so I don’t recall how much room is left but IIRC it wasn’t much when all the features are enabled.

vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri

I would certainly not need those.   I am only using the very basic driver functions.

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Yes - current size is tight - my build for the Roche F6 is 986 bytes, leaving 38 bytes spare - not enough. But if you don't want the LED support (?) confused, why are you using this firmware then? That's the main feature.

With REDGREEN_INDICATORS commented out, it reduces to 970 bytes - not much savings. Adding comment out of LOWPASS_VOLTAGE results in 916 bytes used, 108 bytes free. Maybe with this space it would be do-able.

Oops, re-compiled with flags back on and it's 1012 bytes -- ???

vestureofblood
vestureofblood's picture
Offline
Last seen: 2 weeks 3 days ago
Joined: 08/17/2012 - 15:21
Posts: 1930
Location: Missouri

I use this firmware because its the only e-switch Firmware I know of that I can click for mode up and press for mode down.   Works very well for a headlamp.    If there is a similar option I could be talked into that.

Other than the trubo timer and ramp down function we spoke of I cant think of anything else in it I would need.    My headlamps dont have any red/green leds on them Smile

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.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

TK or anyone that's used bistro. First time trying it, on a wight FET+1 driver, a Tiny25V. It seems to always come up in config mode. There's a pause for couple secs, then it starts from config setting #1 - if I just let it go, sometimes it stops in config #2, one time I let it go thru all settings, and the LED was on in the end, but as soon as I cycles power, it still doesn't work - runs config mode again.

I'm using the fuse settings as specified in the header of the source code. Anyone get it working? Anyone see this happening?

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

Hmmm, I haven’t seen that. I’ve flashed bistro many times, you know, making tweaks, adjusting defaults, LVP, upgrading to new bistro revisions, etc. Though I’ve only used it on attiny85 (normal, not “v”).

You’re trying the newest revision 207 (2015-11-08)?

I see bistro.c mentions these fuses * Low: 0xd2 * High: 0xde * Ext: 0xff
But, TK has different fuses in the latest revision (2015-11-08) of her bin/flash-25.sh flashing script.
http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/tiny25/changes

Commit Summary wrote:
Different tiny25 fuses: No brownout detection, and slower startup.
(am trying to reduce power use and hopefully prevent accidental resets) Selene Scriven files modified: bin/flash-25.sh
avrdude -c usbasp -p t25 -u -Uflash:w:$FIRMWARE -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m http://www.engbedded.com/cgi-bin/fcx.cgi?P_PREV=ATtiny25&P=ATtiny25&M_LO...

You could try those to see if it kills your bug.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Where is the Nov 8 version? Latest source code posted is from Oct 18th, rev 153.1.2 here: http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files/head:/ToyKeeper/bistro/ ??

Hhmm. Looks like she dropped brown-out detection, but didn't update the comments maybe... I'll look into this more.

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

I didn’t notice that bistro has made it into TK’s normal firmware repository.

Her testing repository is where I got the Nov 8 r207 version. http://bazaar.launchpad.net/~toykeeper/flashlight-firmware/tiny25/files/...

~ edit ~
She dropped BOD and also increased the startup delay from 4ms to the max of 64ms. You can compare them with these direct links to each set of fuses in the Engbedded Atmel AVR Fuse Calculator.

bistro.c fuses
L: 0xd2, H: 0xde, E: 0xff in Fuse Calculator

bin/flash-25.sh (2015-11-08) fuses
L: 0xe2, H: 0xdf, E: 0xff in Fuse Calculator

Looking through my files it seems I’ve been using BOD 1.8v, startup delay 64ms (max). L: 0xe2, H: 0xde, E: 0xff. I believe I been using those since the beginning with bistro, ignoring the ones mentioned in bistro.c. Thought a longer startup delay wouldn’t hurt anything.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Ahh, ok. I'll check out that version then, and the fuses. Thanks!

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

Also just try reflashing a couple times. I had a odd, different bug when 1st trying out the tiny85. The bug was there for the first couple flashes, then it just disappeared on a later flash and never came back. I did nothing to fix the bug. No changes. Just vanished. :ghost:

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

I've done lots of 85's with my latest firmware - goes really smooth now, no hickups, but this is my first 25V using bistro. I used 25's back in the beginning though.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Got the new 11-08 version with the new fuse settings (e2, df, ff) and it's still working the same - always comes up in config mode. How is it supposed to start up? Is there a default mode set?

I'm confused, info is sketchy, TK doesn't seem to be around.

bugsy36
bugsy36's picture
Offline
Last seen: 2 months 3 weeks ago
Joined: 07/11/2014 - 18:15
Posts: 2475
Location: Florida USA

Tom E wrote:

Got the new 11-08 version with the new fuse settings (e2, df, ff) and it's still working the same - always comes up in config mode. How is it supposed to start up? Is there a default mode set?

I'm confused, info is sketchy, TK doesn't seem to be around.

I think TK will be back next week. I cannot remember what planet(s) she was visiting but she is coming back soon.

It's the simple things that we take for granted that cost us the most

Ευκαιρία λέει πιάσε με από το μέτωπο γιατί μόλις έχω περάσει δεν θα με πιάσειs

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

Hi, I was temporarily tied up in Mordor, but now I’ve got a few days in The Shire to catch up a bit…

If it enters config mode, it thinks that fast_presses is greater than 15 (at least one of its four upper bits is set) and the OTC value indicates it was a short press.

So, this could mean that the OTC isn’t calibrated. Or it could mean that the mem decay trick isn’t working. I’d start by measuring the OTC values and then plugging them into a new build of bistro.

BTW, the weather in Mordor is nice this time of year.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

I think I got a problem with the OTC cap - I added it later by hand soldering so maybe it got too hot, or bad solder joint. I'll try replacing it. Thanks!

fritz15
fritz15's picture
Offline
Last seen: 1 year 11 months ago
Joined: 01/27/2012 - 13:32
Posts: 307
Location: Denmark

If you want to you can add this firmware to the site:
http://budgetlightforum.com/node/30658#node-30658

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

I’m mighty impressed that you can get internet in the Shire. Big Smile Never looked like they had much in the way of technology, at all. I mean they don’t even know how to make or otherwise acquire shoes! They make the Amish look like the Jetsons.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

Tom E wrote:

I think I got a problem with the OTC cap - I added it later by hand soldering so maybe it got too hot, or bad solder joint. I'll try replacing it. Thanks!

It was the cap - bad solder joint. Once fixed, it came up in 4 modes, well 3 modes plus moon. Think that's the default?

On to the next problem - high mode flickers on for a moment than switch's right a way to the 1st mode. If a use a higher resistance cell, the problem goes away. I noticed this behavior when trying to get a tailcap amp reading, even on the weaker cell. Don't think I ever saw a problem like this - not sure, maybe bad ground. Something to do with high amps, not just FET usage... Dunno. 

Update:

Ok, - got a Fix!! Added a 2nd 10 uF cap sitting on top of the normal one, and wholla! Problem goes away!! Details in Post #580 here.

I've used this type of fix before, on a 22 mm driver.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

Yup, that sounds like the issue I’ve been trying to figure out. About all I know about it is to add a second or bigger cap though, or maybe add a little one between VCC and GND, or something along those lines. I’m really not an electrical engineer.

Tom E
Tom E's picture
Offline
Last seen: 4 hours 4 min ago
Joined: 08/19/2012 - 08:23
Posts: 13414
Location: LI NY

TK - so are you gonna go with the extra cap? Are you still researching it? Is this happening on the X6/X5 driver version?

I'm wondering if there's any other effects - reduced amps or any other flakiness. Have you noticed any side effects?

Update:

The other really annoying issue has been the bright flash/blink, switching from Hi to moon/low. I added back the 12K resistor across the FET gate and it seems to eliminate it. I made some code changes to zero out the PWM outputs upon init, but that alone didn't help. I left those zero settings in the code though, because the state it's in now is perfect.

ToyKeeper
ToyKeeper's picture
Offline
Last seen: 1 hour 51 min ago
Joined: 01/12/2013 - 14:40
Posts: 10614
Location: (469219) 2016 HO3

I tried a lot of firmware tricks to try to eliminate the turbo->moon flash, but nothing seemed to make any difference. It seems to be entirely a hardware issue.

About the extra cap, I’ve been away for a few weeks and can’t do much testing. However, I should have a fix to test when I get back home.

Pages