Attiny25/45/85 FW Development Thread

Wow, you have done even better work than i though.

I wish you luck with testing.

I think (hope) we almost have this resolved. Certainly for my configuration it's working, but I'm trying to get a better solution where we feel more competent it's going to work across all driver layouts and usages - low amps or very high amps. Thinking the max amps I've heard of approach's 20A, maybe 15-18A? Driving 4 or more 219C's in parallel might be the worse case, because those 219C's have a lower Vf than the CREE's and seem to be able to survive at high amps.

Actually, I have to see if the big footprint of the 22 uF caps I have now will fit on a C1 pad... Forgot I'm using a 1210 size cap.

As Tom said, the init code is slightly different.

Also, each driver needs its voltage levels calibrated individually. A raw ADC value doesn’t mean much in terms of volts until it’s calibrated.

As for the code… I’ve found that it works 100% correctly on drivers made by one person, yet fails on drivers made by someone else. And when it fails, it can often be made to work simply by stretching or bypassing the battery springs. This doesn’t point to a software problem, but rather to a hardware problem.

I think the design we’ve been using must have been right at the edge of a tolerance level, pushed up against a boundary, and slight changes to even one component pushed it over the edge. Hopefully future designs will be more tolerant of small changes.

Hmm… Interesting stuff. I haven’t pushed through my latest design changes with OSH Park yet, so I might make these changes before I do. However, is it advisable to stick to the same 10uF capacitor? I see Tom E testing with 22uF. Is 10uF not enough?

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.