Attiny25/45/85 FW Development Thread

sub thanks

There was an issue. The driver would reboot when the FET went from 100% to 0% on a full high-amp cell. Some sort of power spike was knocking it over.

Some people worked around this by using ~20uF on C1 instead of 10uF. And I suggested this to Manker.

However, I never heard anything about how they fixed it. It works now, but I don’t know what changed.

(not to imply there has been any direct contact… because there hasn’t… communication has been an ongoing issue)

Ah, ok. That's exactly the problem I had, sounds like, and think it was only me that tried the doubling up of the 10 uF cap to fix it, originally.

I got 2 of the 3 X6/X6 rev2 sets I ordered, other might be here today or tomorrow. Was wondering because I didn't see any obvious changes, but dunno how to tell what size cap they used. Didn't get a good look at the driver yet - wires were not long enough to fully flip over the driver and was hesitant to unsolder the LED leads. They could have done the cap thing or maybe found a FET that didn't cause as bad a spike.

On that board, the bleeder resistor, cap, and LED+ wire are all done with one solder blob - kind of nasty to work with.

Ahhh ok, all about caps.

I removed the supposed 10 uF cap off the new SS/Cu X6 driver and tested it. It reads about 11.5 uF consistently, while a 10 uF cap reads about 9.6 uF consistently. So, pretty sure they changed the 10 uF cap to a 12 uF, or possibly 14/15 uF. Only ones I could find in 0805 size were 15 uF at +/-20% tolerance, but they might have found a 12 uF in that size.

This could be all that was needed to fix it.

TK,

Whould ATTINY25V-10SU be okay you your firmware ?…i`ve found those at a rofl price arround here

Also, could the threshold temperature be preprogramed, not used defined?

The SU should work fine, but it’s bigger than the SSU. It might not fit onto the usual driver layouts, or it might need its pins bent underneath.

The temperature threshold can be defined in the code (and already is), but I’ve found individual variation between attiny units is generally too wide to make a “factory default” very useful. I calibrated one carefully, flashed the same firmware on another unit, and it started stepping down at room temperature.

Thanks TK!
Will i meet any issues using Attiny 25-20SSU instead of 10SSu?

I doubt it matters much. The data sheet says they’re the same package but 10SSU runs at up to 10MHz with a voltage down to 1.8V, while the 20SSU runs at up to 20MHz with a voltage down to 2.7V.

It’s usually abbreviated here as attiny25 (20SSU) versus attiny25v (10SSU).

Most drivers are using the lower-voltage version, attiny25v. But I have an early one from RMM using the non-V version, and it seemed to work fine too. It just runs the risk of failing before LVP is complete. I don’t know what happens if the attiny voltage gets too low to function.

Last night I tried a Attiny85 on a PD68 Double-down 17mm board for the first time and couldn’t get the 0.1 uF cap across the MCU grnd and VC pins to fix the problem. Also adding the stacked 2nd 10 uF cap didn’t work as well.

I’m testing the driver on the bench, even using a low performing under charged TF Flame cell, and the highest level modes don’t work, and strobe modes don’t work as well (strobe uses full FET). Not sure if it’s just FET full mode, or also the 30%40% 2nd high mode also. I’ll try another 0.1 uF cap to see if it’s just the cap could be.

Boy, sure wish there was someone helping with this trouble-shooting of the 25/45/85 problems. Yes - I’m begging for help again. Also wondering if anyone else is having these problems. Not sure if no one else is working with these MCU’s or just being silent on it.

This behavior of losing all high FET modes is one type of failure. The other is more subtle, where changing modes seems to work for a while then, occasionally resets the MCU - I can tell because in my Narsil firmware, I blink twice with low power on startup.

TOM E, did you try adding a 10uF cap across vcc and gnd? In an investigation thread regarding the FET induced spikes that was the preferred solution.

Ohhh? Shoot, missed that. It was indicated to me to keep the cap as small as possible, interesting… I’ll try that tonight. thanks!! Do you have a thread link, or search criteria I could use to find that thread?

I do, actualy i have a builded driver with a Narsil firmware and initial test show its working but i am quite busy lately at work, family and those hunting flashlights

BTW Tom, what had happened with that Y3-like firmware? Did you finnished it?

Oh boy, refresh my memory… Y3 like? I know I’m behind on many fronts. Work has been, and is goin nuts.

Hi Tom, I could probably do more to help. I have the test equipment, just limited time and still using 13As exclusively.

As discussed last time, you should not need more than 1 uF for local decoupling (the C spanning pins 4 and 8). So 10-20 uF in the C1 spot and an additional 1 uF directly across pins 4-8 should do the trick. It really is not normal for the 13A to work as well as it does without proper decoupling.

I just recently set up a ‘test-bench’ with an A6 driver in the open. The di/dt spiking/ringing on the FET drain pin is impressive. A second improvement you can try is to add 100-200 ohm resistance between the MCU output pin and the FET gate. This will slow the FET switching and reduce the inductive ringing. Depending on the driver PCB layout you will probably have to cut and scrape a track to fit this resistor.

Ohh, the resistor has to be in-line then on that trace. Hhmm - I usually use a 10K-12K resistor on the FET gate, but the resistor goes to ground, so I’m sure not the same effect as what you have proposed. Ok, I’ll see what I have, and see if I can do something like that. Think you might have told me the same thing, or something similar wayy back, but I’ve been using the caps successfully up til now, but on the wight FET+1 boards, not the PD68 Double Down’s.

Actually got some 0402 10K resistors, and am using that on this board for the FET gate to grnd resistor because it fits better to the FET pins. Maybe I should remove it for testing going forward — it’s a real PIA anyway to solder it. Basically, can’t see what I’m doing when I solder, and only with a magnifier afterwards can I inspect it. Gonna go back to 0805’s.

I think this tread should be made sticky, I think lot of people (building FET drivers) have missed this

BTW, from my own research gate and gate pulldown resistors increase inefficiency of the FET by increasing time required to turn it on. Only after FET has been turned on, it has low resistance&heat disipation.

In the solution from the above thread, only a new 10uC cap across +Batt and GND was needed. I think the old Cap & gate resistors are to be removed. Check it out, very interesting thread.

The gate pull down resistor is a good thing normally, a FET gate should not be left ‘flapping in the wind’. One of those components left out for simplicity and PCB size limitations. It may help for the flash some get when going from full-on to moon mode or similar.

True, but the idea is just to take the edge off, not to dampen it so much that the FET is operated any significant time in the linear region. It does put a limit on maximum sensible PWM frequency to use. See the recent BLF D80 driver for an example of how not to do it.

These things are like the suspension on a car. Too hard, or too soft, and you are bound to have a bad time depending on the road you are trying to follow.

EDIT: Thank you for that thread link, but probably the thread discussion was around tiny13a drivers? Seems the 13a is much more forgiving than the bigger MCUs. Local decoupling on any chip like an MCU is basic stuff, it should not be neglected like it has been.

K, spent some time reading thru the comfy FET scope images thread. Post #44 seems to be the result (??) - 10 uF cap in parallel with the diode. I gotta try this... This is old stuff - I followed the thread at the time, somewhat. With all the pics back, it's once again useful info.

Dunno.... Really not sure if I can understand it all, and if there is a final solution from it. dave_'s posts seem impressive/correct, but no real solution posted as a result?

Just fyi, the 10K-12K 0805 resistor I use on the FET gate (to grnd) always works!! No loss of output, definitely gets rid of the flicker switching to moon mode. I've experienced those flicker problems in lights, tore them apart - added the resistor, and then flicker is gone!

Update: removed the 0402 10K resistor, put a 0805 12K in it's place, and with the stacked 10 uF cap, the mode changing problems all seem to have gone away! Dont have any other caps or other extra resistors, just the two 10 uf caps on C1. Testing was on the bench - installing it now in the JM70 light.