Attiny25/45/85 FW Development Thread

Ooops, see above Foot in Mouth.

Might have to re-visit your implementation, but for now, I like the way this is look'n.

For those asking/interested, 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: eswBrOutCfg10-25.zip

I zipped up the whole solution/project. There's 3 required header files now - they are required to be in the same folder as the main source code file (eswBrOutCfg.c). It requires Atmel Studio 7.0 now to use it as-is. That google drive folder also has the batch files for doing the AVRDude stuff: fuses, dnld, etc. The fuses haven't changed.

Next: expand simple strobe to a bunch of blinky modes.

Mike - this sounds awesome btw! Sounds like you got about everything covered. I haven't looked into this much because of not having a dual switch light to use it on. I recall seeing a thread or post w/details on this mod, but not sure where now. I think

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.

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

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

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.

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

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.

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

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

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.

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.

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.

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:

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

^

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.

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:

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?

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.

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.