Attiny25/45/85 FW Development Thread

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 :slight_smile:

Tom - Your Narsil looks very impressive!

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.

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 0x0000
0xff! = 0x87

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!

Thanks!

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

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)

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

Sold again? :frowning:

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 :slight_smile:

Ugh, >600 posts. :wink: :wink: :wink: 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

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.

Would you care to share your code? :slight_smile:

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?

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.

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.

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.

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.

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.

^
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. :)

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?

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.

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?

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