Attiny25/45/85 FW Development Thread

1922 posts / 0 new
Last post
Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Got more done this eve on adding blinky modes - think the UI is good. Didn't test it yet, but should have a 12.5 Hz strobe, random strobe, police strobe, and 10 sec beacon mode. Can easily add more or pick and choose at compile time now - planning on a config UI for these "special" modes (what I call them).

Also fixed a couple of bugs I noticed in strobe and batt check. You can also now abort from batt check quickly.

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

Is there a code repository or something I can pull from to get revisions and updates?

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

This latest is not even dnlded to a driver yet. Hoping a little testing this morn, maybe this eve. Prior vers in post #389.

Update:

The latest source code for this 45/85 version is posted here:

https://drive.google.com- 25-45-85 stuff

It's in a ZIP file called: eswBrOutCfg 10-27.zip

This has the multiple strobe modes, and one 10 sec beacon mode. To access them, simply hold the button til strobe occurs, then simple click to the next, then the next. The selected strobe mode will "lock in" in ~1.2 secs, just like regular modes do. It works pretty well, but I need some sort of delay in-between - hard to tell where you are. There's some other tweaks I need to add, such as navigating to previous mode -- right now only 'next' mode works on a single click. Not much testing (like 2 mins literally), so all subject to change. It's a work-in-progress...

Update:  couple of bugs I noticed in this vers:

  • for beacon, instead of being off for 10 secs, it was on moon mode on one occasion (not always)
  • mode lock-in time (~1.2 secs) should work ok in any strobe (special) mode, but instead of returning to previous solid mode, it seems to always go OFF
Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Oh boy, no responses. If anyone is still interested, latest is now posted in same google drive share as above.

It's in a ZIP file called: eswBrOutCfg 10-28.zip

This now has 3 strobe modes and two beacon modes (i.e. special modes). All 5 of these modes are accessible via the regular way: click&hold til the strobe activates, then click to next, click to next, etc. click&hold to go to previous special mode. A strobe mode will lock-in, just like a regular solid mode, the one click will exit to previous solid mode.

I fixed all known bugs -- all seems to be working as intended so far. It's pretty good. Special modes in order are:

  1. 12.5 hz strobe
  2. Police strobe (same as T_K's)
  3. full bike strobe (also same as T_K's)
  4. 2 sec beacon - 2 flash's every 2 secs (quick flash's)
  5. 10 sec beacon - 2 slow flash's every 10 secs

Need to get in more test time, but think I'll stay with this functionality for now. Anyone who want the source can pretty easily mod these special modes - it's table driven. Most of the rest is configurable thru the UI.

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

Didn’t you originally mention a random strobe? I meant to look at how you implemented your random.

FmC
FmC's picture
Offline
Last seen: 2 months 1 week ago
Joined: 03/31/2013 - 05:23
Posts: 2197
Location: Brisbane, AU

Looking forward to flashing, thanks Tom.

Hopefully my 85v's will turn up tomorrow so I can get one into a light over the weekend.

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Halo... wrote:
Didn't you originally mention a random strobe? I meant to look at how you implemented your random.

Yes - it's in the code, ported over from TK's bistro, just commented out. It didn't look unique enough to stand out. I'm not happy with the transition from one strobe to the next - when the differences aren't obvious it can get confusing navigating. If you look at the code structure, it's pretty easy to mix/match 'special' modes. Clearly, your most important one for quick access should be the first.

I'd like to add even more strobes&beacons, then build out a config UI to allow them to be selected, arranged, etc. Don't think I'll do that now though. I have to stop, do a little more testing, put it in a variety of lights, and hopefully get some more feedback.

Thoughts on my initial roll-out for lights is:

  • SupFire M2-Z continues as a easy to update test light
  • an AS31 (for LJ) (FET+1, just needs a 85V upgrade)
  • X6R - to test it with the NOINIT/brownout option turned on for the X6R's tailswitch
  • the SolarStorm SC01 (modded with my regular e-switch firmware)
  • UranusFire 818 (apart - need to mod up from scratch)
  • SupFire L5 - runs e-switch now, but I must have messed up the LVP so it needs to be updated anyway
  • SupFire M6 - lock-out feature really needed here, runs a e-swtich FET now (~5K lumens)
  • need time for the SolarStorm SC03 (taken apart, not yet modded)
  • Yezl Y3's, ZY-T11 clones, etc.... (modded and unmodded)
  • Need to adapt this somehow to a Convoy/Roche F6...
  • FandyFire K2 (FET based now)
  • Crelant 7G2, 7G10
  • oh so many more....

 

ImA4Wheelr
Offline
Last seen: 1 month 3 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7933
Location: SC

^ Thank you Tom E for sharing your latest versions.  I just received some 85's yesterday.  I hope to flash your latest above and test drive it tonight.

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

I need to get me some 85s and a dual-switch host. Just really busy lately and it’ll probably stay that way for the rest of the year.

ImA4Wheelr
Offline
Last seen: 1 month 3 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7933
Location: SC

Hey Tom E,

Can you tell me what fuses you recommend with your latest release.  I don't want to assume the fuses recommend in the C code has been updated unless you tell me so.

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Yep - those are the fuses I'm using - the ones in the commented code match the 85fuses.bat file posted in the same google drive folder, and that's the one I use.

The current source code has the NOINIT disabled, so it flash's twice when power is applied instead of trying to restore the saved mode. The test light I'm using (the SupFire) doesn't have a power switch.

FmC
FmC's picture
Offline
Last seen: 2 months 1 week ago
Joined: 03/31/2013 - 05:23
Posts: 2197
Location: Brisbane, AU

My 85v's arrived today; looking forward to flashing & testing over the weekend.

The pins are extremely easy to bend to suit the 13a board layout; I just held the 85 on it's side, & pressed the legs lightly against the bench, until they touched the side of the chip.

Beer

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Added 1st draft of a user manual in the same google drive share here:

https://drive.google.com- 25-45-85 stuff

It's a 2 page doc. Both PDF and docx formats are posted.

Update: Hope someone can take a looksy at the manual and tell me what you think. Tried to keep it short and to the point. Made a couple minor tweaks to timing values.

Lights w/85 new firmware so far:

  • SupFire MR-Z test light
  • Rocher AS31 (shipped out)
  • ZY-T11 clone w/XM-L2 T6 4C, MaxToch 26mm - does bout 1500 lumens
  • Another this eve: X6R

Got 3 lights now here with the 85V and e-switch firmware. For the X6R, I turned on the "OffTimeEnable", so I could use the fwd clicky tail switch. Actually, it works kind of nice. It appears the 2 blinks is in the mode rotation on the tail. So, I can enable 2 blinks when the light is powered up from the tail, or, I can set one of the regular modes as the power-up default mode -- interesting feature....

Really liking the battery voltage display - it's coming in handy. The X6R gave me some troubles. Apparently the PWM level of 2 for moon mode is not working on this 7135. Not sure if I installed a 350 or 380 - I was using both. I disabled moon mode for now, and even the low mode is pretty darn low on this light/driver. Hhmm...

ImA4Wheelr
Offline
Last seen: 1 month 3 weeks ago
Joined: 02/03/2013 - 14:51
Posts: 7933
Location: SC

^

I just read your manual.  It reads easy and clear.  Man, you have a lot of nice stuff in this FW.  Can't wait to try it out.  I was hoping to have by now, but I just been to beat after work this week.

FmC
FmC's picture
Offline
Last seen: 2 months 1 week ago
Joined: 03/31/2013 - 05:23
Posts: 2197
Location: Brisbane, AU

I got my first 85 up & running last night, with the most recent version of TomE's code.

I had to up the Moon value a little, but other than that, it works well 'out of the box'.

At first I didn't expect the 'one-click-off' after the mode had locked in, as I was used to being able to step up & down modes like in STAR Momentary. A more thorough read of the manual clarified things for me...

I'm guessing if the line "#define IDLE_TIME" was commented out, the modes would not 'lock in', & you could step up & down the modes?

If so, could this be added to the config table easily enough?

 

I'm about to install this into a D01, can't wait to try it out in a light! Beer

 

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Yes, I believe so - commenting that out should disable it. Probably didn't try it. I'll review it once again. For that moon mode, I used the same value TK had, think a PWM of 2 - originally I used 3. I also ran into a problem with a X6R using 2, but think the X6R driver has a 380 7135. It's working fine on 3 other lights - I think they are using 350's. Do you think yours is a 350 or 380?

FmC
FmC's picture
Offline
Last seen: 2 months 1 week ago
Joined: 03/31/2013 - 05:23
Posts: 2197
Location: Brisbane, AU

It's a 380, but the bench test led is an old XML, so that will have a bearing on it as well.

I ended up using a value of 4 to get it solid.

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Hhmm... I really like the low-ness (is that a word?) of the 2 value. Stupid me didn't fully test it out before assembling the X6R, so might be stuck with no moon mode for a while. Too many other lights to update. Great though I can simply re-configure it to eliminate moon mode. Want to do a lot more of course - endless # of ideas. Also need to install TK's bistro and play with it.

I'm finding the 85 mod upgrade is going pretty smooth. Here's what I do for the FET+1 13A drivers to upgrade:

  • use my slow hot air gun (stamp heat tool) to remove the 13A MCU
  • bend the 85 pins in, try to keep them even - they bend quite easy
  • clean up the pads: use solder wick w/extra flux to remove old solder, clean up with isop. alcohol
  • dnld the firmware to the MCU (MCU is air clipped in)
  • use a decent amt of solder paste on the pads, then use my stamp heat tool to reflow the MCU on
  • I continuity check every used pin (6 of them) - sometimes find a poor pin contact, and touch it with the iron with solder on the tip to fix it up. Even with the bent pins, it's a real tight fit on those pads.

 

light junkie
light junkie's picture
Offline
Last seen: 10 months 2 days ago
Joined: 02/03/2013 - 23:36
Posts: 1696
Location: Sw Az

Tom E wrote:

Added 1st draft of a user manual in the same google drive share here:


https://drive.google.com- 25-45-85 stuff


It’s a 2 page doc. Both PDF and docx formats are posted.


Update: Hope someone can take a looksy at the manual and tell me what you think. Tried to keep it short and to the point. Made a couple minor tweaks to timing values.


Lights w/85 new firmware so far:



  • SupFire MR-Z test light

  • Rocher AS31 (shipped out)

  • ZY-T11 clone w/XM-L2 T6 4C, MaxToch 26mm – does bout 1500 lumens

  • Another this eve: X6R

Got 3 lights now here with the 85V and e-switch firmware. For the X6R, I turned on the “OffTimeEnable”, so I could use the fwd clicky tail switch. Actually, it works kind of nice. It appears the 2 blinks is in the mode rotation on the tail. So, I can enable 2 blinks when the light is powered up from the tail, or, I can set one of the regular modes as the power-up default mode — interesting feature….


Really liking the battery voltage display – it’s coming in handy. The X6R gave me some troubles. Apparently the PWM level of 2 for moon mode is not working on this 7135. Not sure if I installed a 350 or 380 – I was using both. I disabled moon mode for now, and even the low mode is pretty darn low on this light/driver. Hhmm…

Thanks Tom E Iam really pumped about the Rocher AS31 will you do a seperate link for the build of the AS31?

Lj

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Anyone have, or thinking of creating a 20mm FET+1 driver, preferably with 45/85 spaced pads?

pyro1son
pyro1son's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

I can do that if you want might have to wait till the start of next week tho.

EDIT: There is this

If you want anything special done just ask. 3rd PWM output 1 × 7135 + 2× 7135 + FET. Whatever

Pastebin                                      &nbs

FmC
FmC's picture
Offline
Last seen: 2 months 1 week ago
Joined: 03/31/2013 - 05:23
Posts: 2197
Location: Brisbane, AU

Tom E wrote:

Hhmm... I really like the low-ness (is that a word?) of the 2 value.

After getting a driver into a light & messing with testing it for the last few days, I decided to pop it back out & re-flash with a Moon value of 2. The LED is an XP L HI. It was brighter than I expected, but still a very nice usable Moon. I reckon I could have used a value of 1 & it would have been fine.

Oh - this was on a 350 chip as well.

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Ahhh, that PD68 looks real good, in sizes of 17, 20 , and 22 with the 20 and 22 to fit 45/85's. Gotta order some - they will do for sure. Looks like no pads for zener or LDO, but zener should be do-able, not sure how to jury rig up a LDO - have to  research/look around.

pyro1son
pyro1son's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

Pastebin                                      &nbs

Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

pyro1son wrote:
"This?":http://budgetlightforum.com/node/41387?page=1#comment-831895[/quote]

Need a post #. Your direct post link depends on the "comments per page" setting.

pyro1son
pyro1son's picture
Offline
Last seen: 1 month 2 weeks ago
Joined: 03/21/2013 - 08:18
Posts: 432
Location: UK

#46

Pastebin                                      &nbs

Mike C
Mike C's picture
Offline
Last seen: 2 hours 35 min ago
Joined: 01/22/2014 - 08:03
Posts: 2537
Location: Sweden

Tom E wrote:

Halo… wrote:
Is Brown Out Detection needed for the memory decay trick? :~ BOD can be disabled in software but I don’t think it can be enabled in software if the fuses are set to BOD disable.

I’m thinking not because it seems to work, least for me…


Just searched for this discussion as I’ve just come across a few things.

I’m working on my dual switch firmware that has multiple UIs and other stuff, and use a few noinit variables extensively. I’ve just spent the last three hours re-writing code to weed out bugs, but they just wouldn’t go away, like loosing E-switch, strange UI changes and so on. I’d only get these bugs if I was rapidly switching modes with off button, and as I have E-switch, off time cap and voltage monitoring on the same pin I naturally thought the bugs where related to this setup.

Then I remembered that I’d turned off the brownout detection fuses, so I turned them back on… and all bugs vanished. Notice that I did not get the bugs under normal operation, noinit variables where working fine, it was only when I started to stress test the mode changing a little that I started to get really weird behavior. So, depending on what you are doing, the brownout fuses can make a difference. Just thought I’d give you some heads up, because I was tearing my hair out until I figured this out.

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

Mike C wrote:
Just searched for this discussion as I’ve just come across a few things.

I’m working on my dual switch firmware that has multiple UIs and other stuff, and use a few noinit variables extensively. I’ve just spent the last three hours re-writing code to weed out bugs, but they just wouldn’t go away, like loosing E-switch, strange UI changes and so on. I’d only get these bugs if I was rapidly switching modes with off button, and as I have E-switch, off time cap and voltage monitoring on the same pin I naturally thought the bugs where related to this setup.

Then I remembered that I’d turned off the brownout detection fuses, so I turned them back on… and all bugs vanished. Notice that I did not get the bugs under normal operation, noinit variables where working fine, it was only when I started to stress test the mode changing a little that I started to get really weird behavior. So, depending on what you are doing, the brownout fuses can make a difference. Just thought I’d give you some heads up, because I was tearing my hair out until I figured this out.


That’s actually really handy to know about. I had also been trying to figure out whether brown-out detection was necessary. I’ve occasionally seen really strange behavior that I couldn’t trigger again on purpose, and I wonder if this might be why.
Tom E
Tom E's picture
Online
Last seen: 7 min 42 sec ago
Joined: 08/19/2012 - 08:23
Posts: 14122
Location: LI NY

Wait, I'm confused. Even with OTC is it standard to turn on brownout detection? I' thinking I've seen flaky probs also with NOINIT, using th power switch to change modes but with my e-switch firmware, but really haven't tested it much. I got it on a X6R and a Y3 now.

Totally unrelated - Dale reported in TK's firmware thread I believe, a problem with high amps and a 25 MCU, think with multi parallel LED's. I'm having problems now with an 85 MCU with high amps in a FET+1 based driver in a SupFire M6: 4P cells with 3P LED's. I haven't narrowed/isolated the problem down, but seems to work fine on a poor cell like a TrustFire. I gotta begin to isolate it - could be anything to do with this driver at this point. It was fully working 100% with an older FET driver, and I replaced it with a 22mm FET+1. Did my usual careful continuity tests on this driver and all looked good. Also the driver tested fine on the bench with 1 LED. I could try:

  • wire up only 1 LED, not 3
  • replace FET (SIR800DP high performance)
  • 85 MCU? Maybe the firmware?

Dunno - symptoms when it flakes out seems to be problems with FET PWM modes, and seems like the MCU goes out to lunch - gets stuck in blinking state, etc. Maybe I should try turning on brownout detection...

Mike C
Mike C's picture
Offline
Last seen: 2 hours 35 min ago
Joined: 01/22/2014 - 08:03
Posts: 2537
Location: Sweden

Tom E wrote:

Wait, I’m confused. Even with OTC is it standard to turn on brownout detection? I’ thinking I’ve seen flaky probs also with NOINIT, using th power switch to change modes but with my e-switch firmware, but really haven’t tested it much. I got it on a X6R and a Y3 now.


To clarify, I’m using the noinit variables for variables that I’d like to keep track of during short to medium off presses (like mode programming and voltage under load). I do not use noinit variables for off time detection at all any more, I found it too unreliable (was getting 10 second decay periods on some drivers). I use the noinit for short term memory storage only, and found that I certainly need to enable brownout detection fuses for stability, atleast when stress testing.

Pages