Attiny25/45/85 FW Development Thread

Hoping to give some of these new firmwares a try soon! Exciting stuff, for sure.

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.

20mm and bigger is easy I’ve done a few already.

I’ve seen it do that right after a flash, but re-flashing has always fixed it. I haven’t seen it work and then fail though. One thing I’d try if it keeps happening is to switch the fuse for clock speed and tell it to use the longer startup delay. IIRC there was an option for 4us vs 64us, or maybe it was ms… I forget. I haven’t tried though, because it has only failed like once every 20 times I flashed it… and not since several revisions ago.

Fixed, I think. It was using 16/64 for the blinks and 8/64 for the stutter… I just bumped the stutter up to 12/64.

I hadn’t really thought about it, but since 10/64 is “low”, I should probably keep everything except moon at or above that level.

I think it might be an important option. It could, for example, set the thermal step-down back to the original value (without the need to re-calibrate it after turning this option off). It could also quickly reset from “easy mode” back to a regular UI. Assuming the default is close to what you actually want, anyway, which might not be the case.

I suppose, but this is the first time anyone indicated an interest. :slight_smile:

Perhaps, though I suspect some would find it annoying to have a second level of LVP which stops early. OTOH, it also sounds similar to one of the timer options I considered, except it’d be trigger by voltage instead of time.

That sounds nice, but I doubt there’s room. It would probably need to be configured at compile-time in order to fit. Might be possible, but I’m not counting on it. If it’s implemented, do you think it should really be first in config mode?

Also, for “simple mode”, does this sound about right?

  • L/M/H (in that order) at 10/64, 30/64, 50/64. (~10 lm, ~180 lm, ~690 lm)
  • No memory.
  • No moon.
  • No medium-press (so no hidden modes).

Medium-press is now a configurable option. :slight_smile:

Currently, disabled-med-press acts like long-press, but maybe it’d be better to make it act like a short-press?

Unfortunately, not much. Less than 100 bytes.

I’m pretty sure that would bite people when it’s not supposed to.

I have no idea how it would tell the difference between a child pushing buttons a lot and the owner of the light trying to reset it to normal operation. It only has the power switch as input… and on that note:

Exactly. A lot of more advanced features really require an e-switch or a dual switch in order to be usable without sacrificing a goat. The power-switch-only interface is pretty limiting.

That first one sounds like the timer option which was already requested. I’ve been trying to better understand what people would use it for, so thanks for the extra detail. A smooth fade from moon won’t be possible though, since the control resolution is very coarse at the low end.

Stop-motion strobes would have to be fixed speeds for now. I normally have 12 Hz, 24 Hz, and 60 Hz on my EDC. Plus two self-ramping strobes which ping-pong across some fun ranges. But to make it truly adjustable I’d need an e-switch. The attiny clock is also not the most accurate, so it won’t be exactly the speed it’s intended to be. I think they’re still fun though, and they’re really small so I could fit several different speeds.

As usual, testing and feedback are welcome. :slight_smile:

I know I’ve said it before, but there is no need to wait until it’s “done”. Even unfinished code can be helpful. One of the most educational things I ever read was a leaked copy of an alpha version of Quake’s source code. It was full of TODOs and FIXMEs, but I think that may have actually made it a better learning tool.

It sounds like you’ve got all sorts of neat features. Maybe some of them require special hardware, but some sound pretty useful for more general purposes too.

Thanks, that should help new readers. Of course, it’s your thread so you can do as you like with it. :slight_smile:

The repository’s INDEX file will also list projects by which MCU they use, to help people find relevant projects.

I’m getting close to a release-able state with this project, so I’ll soon refer to the project manual and UI diagram instead of the thread. I wonder how to make a diagram for this thing…

Med to act like short would be preferable.

If we need boards with specific layout and with certain pins, let me know I’ll try make a start

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.