Attiny25/45/85 FW Development Thread

Probably… I’ve got everything working on the same pin when it’s not the reset pin, that will free up enough pins, but still I think playing around with these things is interesting. I actually have room to squeeze in a small component or two in all my designs, but won’t make any board designs until it proves to be stable.

I’ve had enough issues getting it all working on one normal IO pin with the OTC less design. I do a lot of stress testing and have had issues with the MCU hanging and not waking up after cold start. It’s taken a while to weed out these issues. Using the reset pin will probably be even more challenging.

Why would you short any pin? I assume the reset pin is normally left disconnected and is internally "pulled" high, ie connect high by high resistance, which is normally about what we'd want to do also if we connected it to something. It is a good reminder that using reistances that are too low might cause problems with programming. Anyone know the impedance on the logic levels of the programmer? 50 ohm? less? For most logic levels though you don't need to pull it far. The tolerance is pretty loose. For reset though you need to pull it below 0.2V. If the programmer impedance is 50 ohm, and you start using 500 ohm dividers, that could become dicey. There are two pins that are not used at all during progamming. So anything that needs to badly break the rules could maybe be put on those?

I explained in post #1468 why I shorted reset with VCC and BAT+. It was just a quick and easy test that the reset pin can be used, that’s all. No long term plans to design a driver that way, just a quick and easy test because it was… quick and easy.

Sorry, I guess I missed some of the details. Anyway, yeah, just adding a resistor fixes it, but it's an added resistor unless doing voltage sensing there too. I was thinking internal pullup, but now I realize that probably doesn't work with adc readout.

I got my hands on some LDOs. Those LT3009s are way too small for me, I was unable to solder any wires onto those tiny pads so I couldn’t test them. They will surely work though, as I’ve tested out it’s larger cousin LT1761 (5 pin TSOT-23) which has the same description in regards to reverse current, and they work as advertised.

Personally I don’t yet need to go as small as the LT3009 because all my drivers can fit the LT1761, so I’m leaving the LT3009s untested for now but am assuming they’ll work just fine.

Anyone else done some testing with LDOs on an OTC less design?

Oh, and another tip on LDO for normal designs is the MCP1703. I tested one to destruction and they’re pretty solid little things. Won’t work for OTC less designs without a diode though, but if you just need a small cheap LDO, these things are pretty solid.

FYI:
I meanwhile completed a driver firmware for OTC-less design. It’s based on my momentary firmware, and it only uses two different switch timings: < 250 ms for short clicks, 250 ms to 700 ms for long clicks, longer than 700ms is recognized as off. Has stepless ramping, special functions on multiple short clicks, and switches mode groups when 1 to 4 short clicks are followed by a long click. It can even do stepless up/down ramping due to the exact timing: up starts with short click and down starts with long click, both stop with next click.

I loaded this firmware into an old BLF X6 FET+1 driver from banggood, only modifications were a 47 uF buffering cap, a 1k bleeder resistor and a connection from batt+ to pin 2. I recognize the voltage drop with pin change interrupt at pin 2, the voltage divider is still at pin 7. Someone mentioned we could still use BOD and switch it off only when sleeping. I did this, but it didn’t work with cells below 3 V, at least with the used cap size. No problems with BOD completely deactivated though.

The driver found place in a triple 219C Convoy S2+ with metal clicky button.
Works like a charm in real life usage, almost as good as a light with momentary switch.

The additional cap even helped with the known Attiny25 problem where spikes from the FET lead to a reset of the mcu at high currents. Not anymore, at least up to 14 amperes without other precautions.

Interesting that the LDO is too small, I could barely even fit it on the 17mm drivers I have been messing with. As long as it works and can be reflowed is all that matters I guess.

Very nice! Now to see if I can get TK or someone to pick through the code and inject the needed parts into bistro….

Edit: Wait so you have ramping working on a clicky light? Yet another thing we need to get on bistro, and when you say stepless ramping, what is that exactly?

Too small for me to solder on wires, but I don’t have the best of eye sight. I’m sure there are plenty who wouldn’t have an issue. Quite sure they’re as easy to mount and reflow as any other, but these aren’t easily available to me so I opted for a model that is.

As that firmware you are going to openly share? I’m using my own firmware, but would like test yours to see if it has tackled issues that took me a long time to sort out.

Well it’s stepless ramping, which means smooth transition from low to high and backwards over a couple of seconds. As in Narsil, for instance.

Not currently, sorry, but I’m thinking of making a version of this firmware publicly available in future.

And it works in a clicky light, so when you short click it stays at the current level?

Yes, but that’s not difficult. I had this option already in my former firmwares with OTC. The advantage of the new otc-less driver design is the exact timing. Pressing less than 250 ms starts ramping upwards, pressing longer than 250 ms starts ramping downwards. And it doesn’t lock ramping after a few seconds (as some ramping firmwares do), so you can ramp at any time in both directions.
The only disadvantage with this method in momentary drivers: you can’t use short clicks for turning off, instead you use a longer click (e.g. >500ms) to turn off. In our new otc-less clicky driver design it’s easier, just turn off completely with the clicky.

This week I built a d80 with triple stack driver running bistro tripledown. I finished today and was excited as I took some extra time with this one. It was working great this afternoon and I decided to rest and then put it through the normal tests to check for runtime and heat and such. So I entered programming mode to disable thermal stepdown. I waited for option number seven. Then clicked within the first second to disable TS. Well after doing that, it went to low mode and stayed there. Now it’s stuck on low without the ability to reenter programming mode.

So I think I might have bricked the firmware:(
The driver and driver cavity are fully potted as well. Anyone have any ideas?
Probably have to dig it out and try a reflash…

Bump to my question. Anyone see this happen before? Any solutions that don’t require reflashing. Thanks

Could my potting material have some capacitance that is draining the off time capacitor? I don’t know if that even makes sense? I’m using atv copper mixed wth 400 grit silicone carbide.

I’m going to take it apart now and try to reflash. If aniyonr thinks there could be some issue with potting material please let me know.

I can’t think of anything and it is possible the potting material is the issue if it was working fine prior to that. I love the performance of a potted light but hate the permanentness of it.

Well surgery went ok. There was some crying and some skill with a scalpel required, but it didn’t take long to open er up. There was some tisue that remained around the legs, but tryied to disinfect the best I could. :slight_smile:

Ya, not sure what the problem was. It worked for a few hours while in the light so I don’t think I it was the potting but not sure. After reflashing, all is well. I think it must just have been a glitch. I shouldn’t talk too soon though, as it is not back in the light yet.

I have found the stability of output with a potted driver to be worth the extra work much of the time. However sometimes I just don’t feel like cleaning up the mess:)

Edit: picture didn’t work

What are you potting them with?

I am using copper ATV mixed with 400 grit silicon carbide. I sometimes put in a bit of 2000 grit aluminum oxide as well.

I wet the silicon carbide with a drop of isopropyl alcohol. I use a small dowel (3mm diameter maybe) and knead by spinning the atv into the silicon against the side of a small glass dish. I then brush a very small amount of silicone oil into the driver cavity(helps in case it needs to be removed) and coat any contact surfaces with contact grease. Then when I press in the driver the potting material squishes out from the contact between driver and the driver lip on the host. I don’t count on this connection for electrical contact though. I make sure there is good connection on the visible side of the driver with a retaining ring or sometimes the battery tube. This mixture is not permanent and can be cut into as you can see in the picture above.

Potting like this really helps stabilize the output for the first 2 minutes especially on small lights. The first light I tested was an olight s30 modded with an fet driver. Without potting the output dropped much after 30 sec but held on much longer after potting. The next light I tested was a convoy s2+ with nichia 219c and a 4.2amp(12pcs amc7135). Definitely a noticeable difference! After the first 2-3mins I’m not sure how much it helps though.

Thanks for the detailed description! I haven’t started with potting myself, something I’ve been aiming to do.