Attiny25/45/85 FW Development Thread

Narsil is written for ATtiny25/45/85. It won’t run on a 13A. The error message is because it won’t fit. Even if it did fit it wouldn’t work as registers are different.

OK, so I guess I missed something :laughing:

Is there a momentary firmware that would fit the ATtiny13A? STAR momentary maybe?

Yep, the title of this thread :slight_smile:

I have no idea what flavors of 13A firmware there are now days, I’ve been done with that little thing since ages ago. You should be able to find a flavor for your needs here somewhere: Flashlight Firmware Repository

:person_facepalming:
Thanks, I’ll look for a FW with beacon mode on your provided link! And will try post in the right thread next time :smiley:

Think it's called STAR momentary, or Momentary STAR, probably under JonnyC in TK's repository -- this should be the e-swtich version for 13A's. There may be others as well. I should make it cleared that Narsil is only for 85's. Even 45's don't have enough memory.

Yes, 13A's are obsolete in this thread . Talk bout tiny...

I’ve found that 1M3 as R1 and 300K as R2 are fine for voltage divider resistors and off time cap charging on single cell voltage drivers. However, I’ve just tested with 2M7 as R1 for double voltage drivers with zeners and found the off time cap charging to take a little too longer than I would like. My intended solution is to stick with the single cell resistors but use the 2.56V internal reference voltage instead of 1.1V. The variation on the 2,56V reference voltage is much higher but I already do calibration on the internal reference voltage.

Anyone tried using same resistors as single cell drivers, but switching to 2,56V for internal reference?

I have!

I sucked it up and replaced the resistor on the driver. It works just fine, now my off time cap measurements are all good, slow charging issues are gone. So for those interested, with the ATtiny25/45/85 the same voltage divider resistors can be used for both single and double cell drivers as long as you switch to the 2,56V for internal reference for double cell readings. I used the option without the external capacitor (page 134, table 17-3 in datasheet). You might have to do some sort of calibration because the datasheet specifies that the 2.56 vRef varies from MCU to MCU even more than the 1.1 vRef does.

I’ll test weather I can stick to 2,56V vRef for single cell drivers too, because if the readings are good enough after calibrating I will be able to clean up my code a little by removing a few #ifdef definitions.

Interesting, that’s all good to know, but not sure I understand how this helps or what problem it’s solving. A 1 cell driver and 2 cell driver have to be different anyway in hardware? You have to use a zener (tail switch) or LDO (e-switch) for 2 cells anyway, so not a big deal to use different resistor values for the 1.1v ref? Plus the complication of extra fine tuning for the 2.56v ref?

It solves my issue of slow cap charging times because of too high R1 voltage divider resistor. I was having issues, I asked a question, then tested and posted the answer. But lesson learned, I’ll just delete the question the next time.

Ahh, no problem. Sorry, didn’t understand - what was the impact/effect of the slow cap charging?

Quick short presses just after turn on where measured as long off presses, and my normal long off presses where being measured as cold starts. I had to wait a short moment before doing mode changing. It was annoying enough for me to attempt solving.

Maybe I’m being slow this morning but with both higher voltage and higher R1, shouldn’t you end up with roughly the same current and charge time?

Ohhh, ok. I’m not a fan of OTC’s use for short/long presses. Just don’t see enough consistency. e-switch’s solve all of that.

That’s what I thought when I decided to go with 2M7 R1 resistors… but it gave me issues. Maybe because 2M7 is a little more than double 1M2? Issues are solved anyway, and now I don’t have to have a stock of separate R1 resistors.

Short and long are fine for me. Perhaps more stable because I have calibrated the voltage readings and use actual voltage levels as short/long off times? I don’t know, but I have consistency with both fully charged and almost depleted cells, and heat doesn’t have much of an impact on the components I have used.

E-switches don’t solve anything if the light doesn’t have an E-switch.

Another question, can I reflow this one
Attiny85

onto and replace the original mcu on
BLF X6 driver
Or
BLF A6 driver

And then flash Narsil onto it?

Is there any difference on the two drivers after the mcu reflow, besides lighted tailcap options on the X6?

No. That version of the tiny85 is physically too large, won’t fit.

That eBay one is a thru-hole, you need a surface mount, and specific size like this one: http://www.mtnelectronics.com/index.php?route=product/product&path=25_104&product_id=601, and note Richard's instructions about bending the pins.

Page 206 here: http://www.atmel.com/images/atmel-2586-avr-8-bit-microcontroller-attiny25-attiny45-attiny85_datasheet.pdf, you want the 8S2 package, and then have to bend the pins to fit.

I've used those from Richard, and these: ATTINY85V-10SU

Unfortunately you may have problems upgrading the BLF A6 with it's inferior components - might have to piggyback another 10 uF cap onto C1, or add a 0.1 uF cap across the grnd and Vcc pins of the MCU. The BLF X6/X5 driver is better, but not great. The BLF X6/X5 driver uses a 12 uF C1 cap, not 10 uF, so in theory should work with a 85 without adding anything else.

Thanks for the quick replies!
If I cut the trough-hole paws on the 85 and bend them over, maybe it can work?
Yes, I already ordered them before I posted :person_facepalming:

So X6 would be best for upgrade compared to the A6.
Do you guys build these drivers from scratch, using Oshpark boards? Even mtnelectronics or 3tronics doesn’t sell anything close…

Yes - I usually build from scratch with OSHPark. Sometimes though I've used Richard's boards that he sells bare. However I've also upgraded boards, such as Richard's fully populated SRK 7135 based drive. I swapped the two voltage divider resistors out to 220K and 47K (to lower parasitic drain), and swapped out the MCU. I didn't need to touch caps or add one - it just worked fine as-is. Here's some pics:

Those double stacked chips look like a work of art. For that matter the whole driver does. :beer: