Attiny25/45/85 FW Development Thread

Haven't sorted this out yet. My 22 uF caps are a little too big for the 0806 pad - dunno what to do at this point. I could try hot air reflow with solder paste and it could grab just enough of the pads... just that everything is so crowded in there, and I don't have a hot air setup that targets well.

When I stacked two 10 uF on the C1 pad, it wasn't a 100% solution. Can't tell what's really goin on without a scope. Could be the 1 uF cap may make all the difference.

All I know right now is the 22 uF cap (1210) on the zener pad with a 1 uF cap sitting on it seemed to be working well.

Hi Tom,

Yes, an oscilloscope is really the way to do it.

FWIW I did scope a 2.8A 105C driving a single XP-L2, 15 kHz PWM. No sign of voltage boosting at C1. Only 160 mV peak-peak switching noise, as can be expected. This is a test-bench setup though. Fed from a power supply with a 1000 uF capacitor 4” ahead of the driver to simulate the cell.

I also did a crude SPICE simulation of a 20 kHz ‘driver’, feeding 12 A to a bunch of ‘LEDs’. The only way I could get the voltage boost was by adding significant parasitic inductance between the ‘cell’ and the driver. In practice this means long wires.

With your arrangement you can probably fit a big capacitor on the ‘motherboard’, leave a 10 uF at C1. I would still use a 1 uF on Czener as well.

Tried following this conversation. I don't have enough electronics knowledge/experience to offer any advice on this high current issue. You seem to have solved it on the voltage in side. I am wondering if you every tried using a pull down resistor on the PWM output though.

No, think DEL recommended that earlier? I'm really not a good one for experimenting around - don't have a good setup, not ready access to variety of parts, soldering skills are ok, but not as good as many here. I really should work on getting a better bench setup and build up some parts inventory.

Ok, I posted a new update to the 45/85 e-switch firmware here: google drive 25/45/85 projects

I cleaned up this share folder now - it has the 3 BAT files I use for AVRDude, and has a ZIP of the full solution/project I use.

Changes:

  • One bug fix: eliminated the short flash that occurs switching from hi to OFF to moonlight mode
  • other minor clean-ups

I had thought the flash was a hardware issue, and attempted to fix it by adding a resistor to the FET gate input. But learned in the last couple of days that when I was changing modes to OFF, I was writing out a 0 to the TCCR0A register, which is probably not valid. I changed this to "PHASE" and can't reproduce the flash anymore in 4 separate lights I've tested it on so far. I also removed the resistor on the FET input pin I had on a couple of them. This problem has been haunting me for a long time now - been asking around, and seeing reports of it on other firmware/drivers, but could be unrelated there - not sure.

I'm not sure if this was just my version, but I'm suspecting it is. I went back to JonnyC's original STAR eswitch version and though he stored 0 for the PWM mode for the OFF mode, it wasn't actually written out to the register.

So, I probably have this same bug in my original e-switch firmware for the 13A as well. A big Oooopsy!

Nice detective work Tom E. Remind me not to be naughty in your neighborhood .

Tanx! Not for nuttin, but how-u-doin?

I wish my pea brain understood the language you all speak. Daughters graduation tonight. She just came home from getting hair etc done. I wasn't sure it was her at first. Shes my last one at secondary school so next year all three of them are at Uni.

And what would be Tom E be up to? Problem solving? I hope not.

Celebrating a crappy World Toilet Day, of course!

You sound a little shitty TP? Did you miss out on an invite?

I always celebrate World Toilet Day. Life sucks without your Porcelain Pal… and a lot of people on this world don’t have a decent one…

My daughters (2) are all dun with school, out in the real world. My older one is a teacher and an assistant high school coach for girls soccer - watched them win the state championships over the weekend - NY catholic schools. She had a full ride at Providence College for soccer, Big East - those were the crazy days, all over the country to catch her play. Haven't seen a girls soccer game in a long time before this past weekend - brought back lot of memories...

It sounds like exciting times again. You must be very proud of them.

I spent a week in NY mid year and loved the place. I have no idea how anyone parks with a two inch gap between cars though. If I ever win the lotto I'd love to come back in the winter time.

^

Thanks Tom E. I'm going to try to install and try out this new version today in a SRK with 4 219C's today. So it should be pretty high current.

Do you have a version of this FW that is small enough to port back to the 13a? I have quit a few 13a's with momentary switches that I would like to update.

Uhhh - was think'n bout it, but right now this is 3500 bytes (3.5KB), and only 1000 bytes available on a 13A. I've been doing the bent pin thing on a 85 and swapping out 13A's. Did a few, so far so good, but almost all needed a little touch of the iron on at least 1 pin - it's not working for all 8 pins every time for me, but little careful TLC gets it fixed up quick.

I believe the e-switch support alone required more code space that a power switch driver, so can't do what TK did for sure, but even hers requires a Tiny25 (2KB).

Didn't do the same "fix" yet either for my 13A e-switch firmware yet. Not sure what you are look'n for - this full functionality or just this bug fix... For the full functionality, I'm even way past the capacity of a Tiny25 (at 2KB).

TK can, and does, compact the code down more than I do. I don't have the patience to do that level of bit tweaking that Dr Jones is so famous for - I want functionality and usability over size.

Sorry, meant, do you have an older version that you feel should work and would still fit in the 13a. I totally understand the latest has many new features that just won't fit.

Ohh- sure. Haven't touched it in a long time, but it works well - but would benefit from the same exact bug fix. Not all drivers had the flicker though.

This link google drive folder has the version for FET+1, and the older version with a single output - both 13A versions.

Update: in my test light, Supfire M2-Z, I've been using the wight 22mm FET+1 board with an 85. I experienced flaky operation on occasion all along I believe - blinks, sometimes it even locks up. I added a 0.1 uF cap on the zener pad and seems like the flaky intermittent problems went away. So, I left the stock 10 uF on the C1 pad. I believe this light and the SupFire M6 were the only two I've used this driver board on, at least with 85's, and both had intermittent problems in the stock C1 setup - caps on the zener pad seem to solve it.

^

Thanks. I think you had a solid 85 version that you published that was still under (or very close) to 1K. Not sure what all you had done to it. I'll try to port it back and fix the issue you mentioned above. If that doesn't work I can go to the 13a version you mention above.

Regarding the newest FW you released: I didn't finish my SRK to test your new FW last night. I should finish it today and then I will report back.

I built up this light: tinywind ultrafire UF-T18, with a 219C on a 16mm Noctigon, using Richard's driver board: https://oshpark.com/shared_projects/acdEm3rR he posted here in post #163. It works great on a laptop pull cell @3.2V, works intermittently on a Panasonic 2800 mAh @4.15v, and doesn't work well at all on a SANYO GA @4.2v.

Quick review of UF-T18: nice compact 18650 e-switch tube light, it's a real UltraFire (driver is branded UltraFire), real SS retaining ring in the bezel, easy thread lock-out on the tailcap, body mounted side switch with 3 wires: grnd, switch, and bonus: RED LED in the switch! But the side switch is not so good - lot of force needed for the thumb, works ok on the tip of the index, or can use your finger nail, but don't think the rubber would last long on finger nail use. Bottom line: the switch is a killer disappointment without a fix, but I am not a side switch modder...

The problems appear to be the same issue I had in the other lights with the 22mm wight FET+1 driver, but now I don't have any zener pad available after the diode. I'm sure the problems have something to do with the low Vf, high amps of the 219C (5000K from Richard). I'll try piggybacking a 0.1 uF on the C1 cap, and see how it works. If it fixes the problem well, this may be the ultimate solution going forward for all 25/45/85 builds.

Richard's board design is pretty good, but using a SIR800DP, there is very little pad space to solder on the LED- wire to. A 22 AWG wire barely has enough to grab on to. I don't think a 20 or 18 AWG wire would be an option - no space, too tight against the resistors. I also have all 3 sizes of PD's DoubelDown drivers (https://budgetlightforum.com/t/-/35301, also post #202 here) - the LED- pad looks better, but haven't tried a board out yet.

Update: the piggyback 0.1 uF helped - tried a Pana PF and seems to work 100% where before it was failing, but on a SANYO GA, strobes don't work, unexpected blinks, etc. - same old problems. Maybe try another stacked 1 uF so I'd have a 10, 1 and 0.1 in the stack?

Boy, dunno... This light is a PIA to be experimenting on - desoldering wires from a sunken LED, 3 pt. soldering of the driver to the brass pill edges.. yuk . No time now - gotta assemble some furniture - my wife went shopping at IKEA...

I am a little surprised that the 0.1 uF made any difference. It really should be right up against the MCU to fulfill its purpose. It is standard practice to have these 0.1 uF decoupling capacitors VERY close to the MCU. We are fortunate not to have more issues with the layout of typical drivers.

In this case best I can recommend is to have a 0.1 uF straddle the MCU. Glue it diagonally to the top of the MCU and run leads/jumpers directly to pins 4 and 8. Pain in the butt for programming though.

Next best option is leave out D1, at the risk of frying the MCU when reversing the cell by accident. Re-use its pads to fit a bigger capacitor.

Did you try running at 4 MHz? That should also give you more room before brownout.