Attiny25/45/85 FW Development Thread

1901 posts / 0 new
Last post
Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

Hhmm, Mitko led me to believe the FET+1 wight drivers were maybe not performing so well, so my last driver mod/build was using a 25 on a single FET driver, and found the "fix" was to stack a 2nd 10 uF cap on the regular C1 cap (doubled up).

Didn't use Bistro, but believe I tried it and had the same problem before the fix, so I think the double up cap would work fine for Bistro. I'm thinking now, Mitko might have run across an issue with using firmware not supporting FET+1's well, where you don't get the max amps you can from the FET, so think it was a firmware issue, not hardware issue of the driver.

So it's weird, but, I got two fixes I've been using - a 0.01 uF cap across the grnd and VCC pins of the MCU (on FET+1's using Narsil), or stacked C1 caps (straight FET driver running my own firmware for a power switch light) or the equivalent with a 22 uF cap instead of the 10 uF used for C1.

Also the 12K resistor across the FET gate worked great to 100% eliminate the flicker going from hi to moon on a power switch setup using a Tiny25 with FET only driver.

chouster
Offline
Last seen: 9 months 3 weeks ago
Joined: 02/20/2014 - 15:05
Posts: 683
Location: germany

Thanks again for taking your time and sharing very useful information Tom.

I played with my driver today, swapped the 380mA AMC for a 350mA one, still no moon. Had to adjust the values. I wonder why this driver doesn’t show any of the issues that’s been talked about. Maybe I’ll encounter some when I hook it up to a triple. It’s still driving a single XM-L2 now. I am also going to test a longer start up time fuse setting to see if that’ll make any difference.

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

What PWM value was it before/after for moon? I don't think the problems consistently occur on every driver, every LED/amps, etc. Lots of variables.

Mitko
Mitko's picture
Offline
Last seen: 2 days 10 hours ago
Joined: 09/19/2014 - 05:20
Posts: 1529
Location: Bulgaria

I builded my first A85 driver today, tom`s design( Thanks for your effords mate) and initial tests shows its has great potential especialy in Y3 style/double flashlights, will update tomorroy with some questions cause my kids want a bed story Smile

bugsy36
bugsy36's picture
Offline
Last seen: 1 year 5 days ago
Joined: 07/11/2014 - 18:15
Posts: 2475
Location: Florida USA

Tom - Your Narsil looks very impressive!

It's the simple things that we take for granted that cost us the most

Ευκαιρία λέει πιάσε με από το μέτωπο γιατί μόλις έχω περάσει δεν θα με πιάσειs

chouster
Offline
Last seen: 9 months 3 weeks ago
Joined: 02/20/2014 - 15:05
Posts: 683
Location: germany

Started with
380mA AMC and PWM-value 3, no light.
350mA AMC, PWM-value 3, no light.
350mA AMC, PWM-value 4, one of the lowest lows I’ve seen. Very cool to look at, but for me maybe a bit too dimm in terms of useability.
350mA AMC, PWM-value 5, that’s what I went with for now.

I didn’t know that a X+1*AMC350mA-driver can give that low of a low mode!

I used TK’s level_calc.py to calculate ramp levels. More re-flashing to come, want to play around with it some more, calibrate voltage and adjust OTC-values to my liking (faster).

I agree with bugsy36, your Narsil looks very impressive, indeed.

chouster
Offline
Last seen: 9 months 3 weeks ago
Joined: 02/20/2014 - 15:05
Posts: 683
Location: germany

Hi guys, could someone please help me with troubleshooting?

I’m trying to get bistro running on PD’s Double Down driver, but it won’t flash.

ATtiny25 is mounted to the driver already, driver is installed in a light with long wires.

I get this

verification error, first mismatch at byte 0×0000
0xff! = 0×87

I don’t think the problem is in the connection, I can flash tiny25 airwired, but not mounted. Have my connections to the programming clip like in Hoop’s tutorial.

Because of the long wires, I was able to desolder C1 and tried to flash again, same story.

Do I have other options before pulling off the tiny25 to flash it unmounted?

EDIT: Never mind. I don’t know how but I got it running. I have a new favorite light now:

EE X6 3x XP-L HI U6 5A, bistro on PD68DD with FET+2, it’s amazing!

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

bugsy36 wrote:
Tom - Your Narsil looks very impressive!

Thanks!

Mitko wrote:
I builded my first A85 driver today, tom`s design( Thanks for your effords mate) and initial tests shows its has great potential especialy in Y3 style/double flashlights, will update tomorroy with some questions cause my kids want a bed story :)

Thanks, any Q's/comments/thoughts/suggestion, please let me know. Always look'n for feedback.

chouster wrote:
Started with 380mA AMC and PWM-value 3, no light. 350mA AMC, PWM-value 3, no light. 350mA AMC, PWM-value 4, one of the lowest lows I've seen. Very cool to look at, but for me maybe a bit too dimm in terms of useability. 350mA AMC, PWM-value 5, that's what I went with for now. I didn't know that a X+1*AMC350mA-driver can give that low of a low mode! I used TK's level_calc.py to calculate ramp levels. More re-flashing to come, want to play around with it some more, calibrate voltage and adjust OTC-values to my liking (faster). I agree with bugsy36, your Narsil looks very impressive, indeed.

Thanks Too! Glad your problem worked out. I found a few issues in getting those errors, and some others, from time to time:

  1. Not having the grnd wired properly wired in my clip setup (once I did this, many intermittent probs went away)
  2. flux on the MCU pins (and gets on the clip contacts) causing intermittent issues (cleaning with isop. alcohol works wonders, always!!)
  3. not getting a good "clip" on the pins, maybe mis-aligned, maybe something in the way (not happening very often now)
texaspyro
Offline
Last seen: 11 months 3 weeks ago
Joined: 04/29/2011 - 12:43
Posts: 4593

Looks like Atmel has been sold… to Microchip… so long competitiion, you will be missed.

http://www.theregister.co.uk/2016/01/15/microchip_atmel/

Pablo E.
Pablo E.'s picture
Offline
Last seen: 1 year 7 months ago
Joined: 08/08/2015 - 13:54
Posts: 234
Location: Spain (GMT+1)

texaspyro wrote:
Looks like Atmel has been sold… to Microchip… so long competitiion, you will be missed.

http://www.theregister.co.uk/2016/01/15/microchip_atmel/

Sold again? Sad

BTW, stacking a second 10uF cap works like a charm, now my flashlight is flawless.

My sincere congratulations to all the people who made this possible Smile

wight
Offline
Last seen: 2 days 7 hours ago
Joined: 11/27/2013 - 16:40
Posts: 4967
Location: Virginia, USA

Ugh, >600 posts. WinkWinkWink It feels like being back in the booster seat. If I’ve ever gotten mad at a noobie for not reading the entire thread (I have!), I repent. I was trying to read front to back, but it’s taking a long time. Maybe I’ll try back to front.

I’ll throw down a few things now anyway with only 20% of the thread under my belt so far. I apologize in advance.

  • First of all, looks like neat stuff. As you all know, any move to physically larger MCUs is a pain for the CAD folks – so I tend to resist that change. If it nets us nice thermal protection features though, I’ve got to be game! As usual I’d prefer to try cramming in the 20M1 package with ISP headers for programming.
  • On the failures to program – IIRC the OTC can be the culprit here. Again this is only if I recall correctly – but I think that leaving the programming clip hooked up can charge the OTC and prevent additional flashes from being successful. As I recall a trick is to get your hex all ready to flash, discharge the OTC if necessary (with tweezers) and then clip and flash fairly quickly.
  • Tom E – did you ever get a handle on the calibration points you wanted? 0c and 100c are easy to reliably achieve using ice-water and boiling-water so those are common at-home calibration points. Atmel bins some chips (not the ones we buy) for 105c and 125c, I think it’s fair to say that all of them are going to be OK at 100c long enough for a one-time calibration routine. Just throw the light in a plastic bag and drop it in for a while, right?
  • I wonder how much better an LDO driver would fair with the stuff mentioned in post #601 by Tom E. I did publish an LDO driver a while ago – it’s probably suitable for testing. A17DD-SO8+LDO

Break’s over for now. That was a long one! wight catchup WinkWinkWink
list of my drivers & variants (A17DD, FET+1 stuff, WIP stuff, etc)

ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

I got a bit behind here too… though not nearly as much as wight.

If I understand correctly, the driver reset problem was fixed by using a bigger capacitor. It was rebooting on the trailing edge of a FET full-output pulse. So, turning the FET from 100% to 0% caused a spike of some sort.

The brownout detection options don’t seem to make any difference in any cases I’ve tried. The 4ms or 64ms startup delay doesn’t seem to make any significant difference either.

I’m going to have to try some new tricks to get some bricked drivers flashed… I hadn’t thought about manually draining the OTC before or during flashing, but maybe it would do the trick.

ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

Rick NJ wrote:
I already have my own firmware written for the ATTINY13A. It has all the functions I wanted but a very bad UI for selection. I was at around 1020 bytes. So, to do a better UI, I need more flash space.

Now, my 4 ATTINY85V flashlights has the features/functions I wanted exactly.

Would you care to share your code? Smile
ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

Also, the last version I have for Narsil was still called eswBrOutCfg. Can I simply rename it, or are there extra changes to pull in along with the name change?

ImA4Wheelr
Offline
Last seen: 12 hours 45 min ago
Joined: 02/03/2013 - 14:51
Posts: 7779
Location: SC

wight wrote: . . .

  • First of all, looks like neat stuff. As you all know, any move to physically larger MCUs is a pain for the CAD folks – so I tend to resist that change. If it nets us nice thermal protection features though, I’ve got to be game! As usual I’d prefer to try cramming in the 20M1 package with ISP headers for programming. . . .
  • Tom E – did you ever get a handle on the calibration points you wanted? 0c and 100c are easy to reliably achieve using ice-water and boiling-water so those are common at-home calibration points. Atmel bins some chips (not the ones we buy) for 105c and 125c, I think it’s fair to say that all of them are going to be OK at 100c long enough for a one-time calibration routine. Just throw the light in a plastic bag and drop it in for a while, right?
  • I wonder how much better an LDO driver would fair with the stuff mentioned in post #601 by Tom E. I did publish an LDO driver a while ago – it’s probably suitable for testing. A17DD-SO8+LDO

I've been pushing for keeping the SSU footprint on the boards and just bending the legs.  It really makes it easier to position the programming clip and the hold is much better.  Those that have tried it have reported positive experiences so far.

I don't think temperature read calibration is worth the effort.  Each light is going to behave differently anyway due to many factors.  User adjustable seems the best approach to dealing with all the variables.

I think you may be on to something with LDO, I've been putting my 25/45/85's in buck and LDO (at opposed to zener modded) DD drivers and haven't had any issues yet, but I'm also using an older version of Tom E's FW for the 25/45/85.  Unfortunately, the LDO I use is for 2S and higher cell arrangements only.

EDIT:  Another benefit of bending the legs (which is easy) and is that the MCU stands higher.  It allows low profile components like resistors and small caps to be placed right up to the legs, if necessary.  Resistors could even go under the MCU.

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

Oh boy, now I'm behind... Latest Narsil is on my google drive - posted share earlier?? It's all renamed though to Narsil - it uses your header files though.

This should get you all the files: https://drive.google.com - full set of Narsil files. I'm think'n I had updates of Dec 12th, very minor maybe, maybe no change at all... Don't have access now cause @work.

I never did anything bout temp cal. TK has a pretty good solution though in Bistro, and didn't really explore/work with it yet. I'd probably lean towards dropping her implementation in to my code base.

The bent pin thing works well for me so far as well, though not liking the narrow pin contact - seems vunerable for solder issues.

ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

FWIW: After carefully calibrating a thermal ceiling on one driver, I tried the code on another driver… and it started stepping down at room temperature. It seems there is significant variation between individual MCUs.

So, I built in a runtime config option for it instead. Turn the light on at the highest level, read and save the temperature once per second, and when the user decides it’s too hot they can turn the light off. This becomes the new thermal ceiling.

The tricky part is getting heat to the MCU quickly enough for it to be a useful measurement. The MCU is usually surrounded by a buffer of air, so heat travels slowly. It would probably be a good idea to stuff some thermal-conductive foam between the MCU and the pill. This wasn’t an option for the X6/X5 though, so instead I gave it a really strong lowpass filter to keep the regulation from bouncing due to thermal lag. It works, but unfortunately makes the regulator pretty slow.

It’s debatable whether thermal regulation is even relevant for such a big copper pill though, so it also has an option to turn regulation off. The first two seconds of thermal calibration mode only have the light on a dim mode, and if the user clicks during that time it sets the ceiling to 255.

Mike C
Mike C's picture
Offline
Last seen: 2 months 4 weeks ago
Joined: 01/22/2014 - 08:03
Posts: 2009
Location: Sweden

ImA4Wheelr wrote:
I’ve been pushing for keeping the SSU footprint on the boards and just bending the legs.  It really makes it easier to position the programming clip and the hold is much better.  Those that have tried it have reported positive experiences so far.

I’ve gone one step further. I made my own footprint for the 85 with bent legs, it’s a little smaller than the original 13A footprint so it gives me even more space. It’s verified and working on several of my boards.

ImA4Wheelr wrote:
I don’t think temperature read calibration is worth the effort.  Each light is going to behave differently anyway due to many factors.

I do. I do a single point calibration at room temperature, simply because I like to know the temperature that the MCU is at. Once temp is calibrated I do the routine that Toykeeper uses to set the max allowed temperature. I don’t have to do a temperature calibration for that, but as I have temperature readout (in Celsius), it is worth it for me. I’ve seen up to 15 degrees Celsius differences between MCUs at the same room temperature.
ImA4Wheelr
Offline
Last seen: 12 hours 45 min ago
Joined: 02/03/2013 - 14:51
Posts: 7779
Location: SC

^
Good stuff Mike C

First off, you know a whole lot more than me on pretty much everything Electronics and FW.  So I defer to you by default on pretty much anything you say.

Second, Great idea on the legs.  I do find that if I push the legs (push on the inward arch above the "foot") all the way until they touch the chip, the legs barely make contact with the SSU footprint. 

Third, That room ambient temp calibration idea makes sense.

EDIT:  I just remembered that I have done the same thing regarding the SSU footprint.  I was working on some boards (LDO bucks and LDO DD's) and did the same thing but only extending the inside part of the padst.  Now that you mention it, I should bring in the outside part of the pads too.  Thank you again.  Smile

pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 3 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6419
Location: Held against my will in IOWA, USA

I’m about to place a mouser order and haven’t kept up with the testing for awhile. Is there a reason to buy 45’s vs 85’s or vice versa? Are the ‘v’ versions necessary?

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

45 vs 85 is just a matter of space and cost. I figure I’ll mostly get 85-based drivers because I don’t see much point in the 45.

My non-v 25 driver seems to work fine, but a v version should in theory let it work at somewhat lower voltage. The non-v might die before LVP finishes activating. I haven’t tried one below 2.7V, so I’m not sure exactly how low it’ll go.

pilotdog68
pilotdog68's picture
Offline
Last seen: 1 month 3 hours ago
Joined: 05/30/2013 - 23:31
Posts: 6419
Location: Held against my will in IOWA, USA

I thought I remembered someone having more trouble flashing either 45 or 85 at some point but I can’t remember which. I’m only planning to order a few so cost isn’t a huge issue, should I just go with 85v’s?

My Favorite Modded Lights: X6R, S8 , X2R , M6, SP03

Major Projects:  Illuminated Tailcap, TripleDown/TripleStack Driver

texaspyro
Offline
Last seen: 11 months 3 weeks ago
Joined: 04/29/2011 - 12:43
Posts: 4593

I suspect that if you decapsulate the two chips, you will find that they use the same chip die inside…

Halo...
Halo...'s picture
Offline
Last seen: 2 years 2 months ago
Joined: 12/15/2011 - 02:39
Posts: 3304
Location: Halo island

I’d recommend plain 85. 45 is pointless, same package size but less code room. I’ve actually seen 45 be more expensive in some places. So far no one has shown a need for the low voltage “v” versions. And they are a good bit more expensive.

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

TK (or anyone who knows) -- I thought there were some issues with the X6/X5 Rev 2 ATTiny25 based drivers. I had to double up the 10 uF cap or add another cap after the diode to get it working reliably at high amps. Was that a problem? If so, how was it solved?

I thought TK mentioned this a while back - was anything done in hardware to the drivers that shipped? It couldn't have been a firmware change because they shipped it with the October version.

** For the 45/85 issue - I agree, for same cost go with the 85. I bought my last 85's from Richard.

fatboy
Offline
Last seen: 1 year 8 months ago
Joined: 11/17/2012 - 08:18
Posts: 223
Location: MN

sub thanks

ToyKeeper
ToyKeeper's picture
Online
Last seen: 9 min 17 sec ago
Joined: 01/12/2013 - 14:40
Posts: 7929
Location: (469219) 2016 HO3

Tom E wrote:

TK (or anyone who knows) — I thought there were some issues with the X6/X5 Rev 2 ATTiny25 based drivers. I had to double up the 10 uF cap or add another cap after the diode to get it working reliably at high amps. Was that a problem? If so, how was it solved?


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)

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

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.

Tom E
Tom E's picture
Offline
Last seen: 1 month 1 week ago
Joined: 08/19/2012 - 08:23
Posts: 10899
Location: LI NY

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. 

Mitko
Mitko's picture
Offline
Last seen: 2 days 10 hours ago
Joined: 09/19/2014 - 05:20
Posts: 1529
Location: Bulgaria

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?

Pages