Attiny25/45/85 FW Development Thread

I originally made it act like a long press, because that’s how I personally like it when I don’t have medium-press. It lets me reset to the first mode faster. But I realized that feature isn’t really for me, it’s for people who don’t like medium-press. Like DavidEF pointed out, some people have trouble clicking fast enough to be “short”, so I made disabled-medium act like a short press instead.

Also, I think RMM published a 17mm FET+1 board modified to fit the tiny45/85, but I don’t recall where the post was… I’ve been sticking with tiny25 only because it doesn’t need any board layout changes, and because it’s the only model I have for testing.

pyro1son wrote:

I’m trying to make a 17mm single side FET + 1 board that will take these larger chips. It’s a very tight fit. I’ve managed to get it all on but I’m not comfortable with how close some parts are so I’ll keep playing.

It's so easy to bend the pins in that you may want to consider sticking with the SSU footprint on 17mm boards. I generally bend the pins regardless because it's so much easier to attach a programming clip.

FWIW, the new “muggle mode” is working. I’m not totally sure what to think of it, but it certainly does make things simple, and it’s easy to enter or exit. It doesn’t overwrite other config settings.

Hey, muggle mode! :bigsmile:

What’s funny is that I suggested it yet I don’t even loan out my better lights often. :zipper_mouth_face: Though maybe I will now.

Flashed.

Oh, I forgot about the factory reset thing. It’s really easy so I added it.

TBH, I’ll probably add more options than I can fit. I already did, if you count the random strobe which is disabled by default. The question is what to include by default.

Even though it’s not quite full yet, the config mode is a bit long and unwieldy with 8 different options available. I tried to put the more frequent options at the beginning though. Not sure if my guesses are right though. Like, should memory come up sooner? Should things generally be in a different order? Currently the options are:

  1. Noob mode toggle
  2. Mode group
  3. Moon toggle
  4. Mode order, l-to-h or h-to-l
  5. Memory toggle
  6. Medium-press toggle
  7. Thermal calibration
  8. Factory reset

I do sort of feel memory should be high on the config list. But what bump? I always turn mem on.
I guess since you asked I’d go for this order.

  1. Noob mode toggle
  2. Moon toggle
  3. Memory toggle
  4. Mode order, l-to-h or h-to-l
  5. Mode group
  6. Medium-press toggle
  7. Thermal calibration
  8. Factory reset

Maybe a couple polls to help determine the best order for most people? How many people use memory? Moon? H>L, L>H? Ones that are closest to a 50/50 should probably go higher since whatever the default is, quite a few people will be looking to change it.

Flashing bistro 202

I’m not sure a 50/50 indicates it should be early in the sequence. It’s more that the things people change frequently should be early. Options which only ever get touched once can be at the end.

So far, I’m doing a lot of guessing… because I don’t think these are things which have been discussed much around here. Or at least, not in threads I was paying attention to.

For just myself, I’d cut out the config options and hardcode the firmware how I like. It’d easily be half the size or less. But most people don’t seem to have the tools or interest for reflashing. So I hope to cover most preferences without the need to reflash.

I was thinking some button presses other than “short” to be needed in order to change between “muggle friendly” and “normal” mode. If Medium press is able to be toggled off, then you wouldn’t want it to be used for this, but a clever combination of short and long press maybe? I dunno what’s possible.

Edit: I guess if it doesn’t take too long to get into config mode, but it takes more than just a series of short presses to get to it, and the toggle for “muggle friendly” is the first option, it will be useful. What I don’t want is to take a long time switching. The most obvious reason is that delays draw attention. I don’t want anyone to get curious about what it is that I’m doing to the light just before loaning it to them and soon after getting it back. :bigsmile:

something like 3 short and 1 long would work well. In an e-switch 3 short and hold would be best.

Unfortunately, we don’t have an e-switch… nor any way to store much info about button press sequences without putting a lot of gunk into eeprom. More complicated stuff will be possible with an e-switch or dual-switch host.

Can you read 3 quick presses with clicky switch?

I’m using a noinit variable to track how many times in a row the user has fast-pressed. It can count 3 easily enough, but that’s low enough that the user may hit it by accident while changing modes. The config mode triggers at anywhere from 16 to 31 fast presses, long enough not to happen during regular use.

So, quick press sequences are already implemented, but it has no way to track mixed sequences of medium and short presses. A medium press is long enough for RAM to decay, so it wipes out the noinit variables. That leaves eeprom as the only way to track it, which would require a lot more code (and ROM space) and would eat through the eeprom write cycles an order of magnitude faster. It’s a bit difficult to reliably get a medium-press too, due to the lack of feedback while off, and the temperature-related timing variations.

Because of these things, I’m not planning to implement mixed sequences without an e-switch.

I neglected to mention my rational. A lot of people seem to already have a preference when it comes to these config options. If you know what you like then you will only access a given config option once, if the default isn’t already want you want.

If the popularity of mode memory is 50/50 then regardless of what the default is, half of the users will be going in to change it. If the popularity of moon mode is 49/51 then the default should be whatever 51% prefers. And 49 out of a hundred users will be looking to change that config option.

What about people who don’t know what they like? Ah, ignore them! How could we predict how frequently they would toggle an option?

Muggle mode is the only one imo with the potential to be accessed semi-frequently by some users.

I see you switched the options around a bit in bistro 205, looks good to my eye. Of course it’s all a guess. :stuck_out_tongue:

I'm looking to purchase some 85v's, but there are a few different types.

http://au.rs-online.com/web/p/microcontrollers/7380690/

http://au.rs-online.com/web/p/microcontrollers/6962342/

Those two appear to have the shorter legs that can be folded to suit the 13a board footprint.

TomE, which one have you been using with your current e-switch firmware?

Cheers :beer:

- edit -

This is the filtered list of 1.8volt Attiny's that are available to me, including the 25 & 45's.

For tiny13 and 25, get the SSU package. For 45 and 85, get the SU package. It’s the closest available to SSU.

This should allow the chips to fit onto existing drivers and be flashed in place with a common SOIC8 clip.

Thanks TK.

I'm almost finished reading through this thread from the start;

I'm ordering some 85v-10SU's, & using TomE's files from post#304, I should be good to go, as long as my wiring on my clip is correct...

Sorry, haven't been keeping up with this thread as of late. I'm still working on my version - calling it: eswBrOutCfg for now (e-switch BrownOut w/Configuration settings).

The last 85's I bought are these: http://www.mouser.com/Search/ProductDetail.aspx?R=ATTINY85V-10SHvirtualkey55660000virtualkey556-ATTINY85V-10SH. I think I went with the SH because I tried the SU in the previous buy, so I thought I might have a long shot at programming them more reliably, but that was before I figured out the ground problem in my SOIC-8 clip wiring.

SH are matte tin leads, while SU are NiPdAu leads. Not sure if one is better than the other for our application of soldering - I use lead based solder. I'd say go with the cheapest, but dunno -- one may be better... I see Richard is selling SU's for the 25 and 85 - great prices, but not the "V" lower voltage spec version.

The config settings are pretty awesome. I changed the order around, hopefully for the better. 1 thru 6 now makes a whole lot more sense. Here's what I'm using now:

Mode Set Order

Mode Count

Mode Percentages

Notes

1

1

full only

(full is always max FET, no 7135)

2

2

10-full

max 7135, max FET

3

3

5-35-full

5=1/2 7135, 35=mixed

4

4

2-10-40-full

10=max 7135, 40=mixed

5

5

2-5-10-40-full

10=max 7135, 40=mixed

6

6

TK BLF A6 7 mode

6 well evenly spread

7

3

10-35-full

10=max 7135, 35=mixed

8

4

TK BLF A6 4 mode

4 well evenly spread

Moon mode has been broken out separately to enable/disable it.

Thanks Tom.

I noticed an SH version that is listed as only having 256B RAM, rather than the 512B of the others. Not sure if that will have any bearing for our usage or programming.

That must be a typo - I don't believe the Atmel spec sheets say that. I'd trust the Atmel data on this. I'm using Atmel Studio 7.0 now, and Studio definitely sets the 85 (any 85) for 512 bytes RAM.

That makes more sense.

Are you planning on adding the "eswBrOutCfg" to the Repository?