Attiny25/45/85 FW Development Thread

I am not sure if that is the case in this particular LDO, didn’t look at it very close. I know with the one I researched when building the LDO TA drivers this was the case.

It would simply fall out of regulation down until it shut off at the “startup voltage” It is apparently hard to find this startup voltage in many data sheets.

Lots of interesting ideas here!

Did not read all of it, but some considerations:

  • For 2S the Zener is normally required (if no LDO regulator). The drop over the series resistor will otherwise vary inversely with MCU current draw. IOW: MCU goes to sleep -> 2S V on MCU -> MCU may not wake up again…

The Zener is used here as a shunt regulator, which is inefficient by definition - it maintains voltage by draining surplus current not used by the load.

Now why did it work without the Zener? Only reason I can think is that the MCU has some intentional or un-intentional clamping built-in and the 200 ohm limited the clamping current to ‘safe’ levels. Probably not something to rely on.

  • C2 is the MCU decoupling capacitor. A good selection is something that can respond fast. Typical values are below 1 uF, better around 100 nF. Larger capacitors have larger parasitic inductance. (However, we can probably get away with a lot in our application.)
  • The bat-R5-C1-ground loop should be kept small and away from sensitive circuits. There are huge voltage spikes on bat that tries to find its way to ground via C1 (and of course the cells). D1 should not be inside this loop. Even with R2 at 4.7 ohm there are 1-2 A current spikes in this loop that can eventually kill D1.

My numbers are from a kind of worst-case setup (4 x 30Q cells in parallel, 4 emitters in parallel, longish wires everywhere). Lower power builds might be OK for the above.

For the LDO:

  • Output capacitor is critical. Most LDOs require a few uF for stability. Some do not like ceramic capacitors.
  • R5/C1 should be there for the same reasons we have them now. C1 as small as 1 uF should work though. R5 could be much larger, but that would upset voltage measurement.

So R5 > C1 > LDO > C2 > MCU. R1 tapping from the C1/LDO node. D1 at input to LDO, or LDO pads to accept D1 when LDO is not used.

I was hoping you would chime in DEL.

So in your opinion with the new OTC method being talked about, what is our best option going forward?

A large C2 to power the MCU as a replacement for the OTC?

Should we switch to using an LDO or should we keep R5, C1 and the diode?

Sadly unless we loose at least 2 other components an LDO is not an option. Oh well, it was an idea.

I know, I said I would shut up for some time… Just found two nice posts from years ago that relate to this. Comment #195 and #196. Funny…

The first post is quite interesting, Jones is quite the forward thinker. The second luckily doesn’t apply now days with custom oshpark PCB’s,

I am curious what kept this from coming to be.

So is Tido. Would be great to have him around these days…

So I looked at the current vs vcc charts for the mcu manual, and the thing look surprisingly like a resistor. So yeah, it seems possible for it to work withotu the zener, at least until it enters some kind of very low power state, and no longer pulls enough voltage sag across r5. Good point about fast response. Anything above 10uF isn't really rated for speed at all and even 10 and 1u don't seem as much so. I'll have to ponder the rest. But part of the option I was placing was that the R5 you're talking about, which kind of serves a different purpose I think from the big R5 the zener needs, could be place on the C1 ground, or included in the ESR of C1 no? Anyway, maybe that's not even needed, the main idea was really just to get R1 connected to the battery, so better maybe to think of it as moving the R1 connection than moving R5.

^

That was my concern.

I think a typical trick when you need a big capacitance and a fast capacitance is to use a small ceramic and a big tantalum cap side by side. The Ta serves as a moderate impedance power source and the ceramic does its high speed thing. It's an extra cap on the board though. I wouldn't think that should bother the ldo.

From what I understand about R5, it was put in place to take care of spikes of about 6V. Why would a LDO with rated input voltage of 16V need it? That the spikes are bad the MCU I can understand, but not why they are bad for the LDO. I guess with a 2S setup the spikes might be a different matter, but maybe still under 16V?

Note: I’m not challenging anything! Just trying to learn. This stuff is all pretty new to me, just trying to get my head around it.

About 4 V on top of the cell 4 V IIRC. It can only be worse with 2S. But, as you say, the LDO may handle it. Regulators, however, do not have infinite PSRR and some of it will get through or compromise its internal stability.

Two other smaller concerns re. removing R5:

  • Without R5 we are basically shorting the spike to gnd via C1, with ‘interesting’ resulting currents here and there. Going with a higher ESR capacitor (tantalum) will help a little, but does nothing for point 2:
  • It would mess with what is going into pin 7, assuming R1 taps from C1. LVP coding will need to account for sporadic high readings. We also need to make sure we stay below VCC at pin7.

Yep it would get through, but then there is C2 to absorb that. I also wondered about noise on R1. I think if you have 5 ohms in C1 and a bit of resistance on the mcu leg, it's the same as far as R1 cares as having it before the split. Either way there's 5ohms in series with all the current coming off the battery. So long as we're only talking about 5ohms, the voltage drop across the resistor itself is irrelevant, just the spike-current limiting which is the same with resistance above the Y or on the legs of the Y.

a) C1

|---------||------>

batt+noise------5R --|

|-----R1--R2->

V (this is the schottky diode)

|--------||------> (this is C2)

|-mcu---->

will damp the noise seen over R1 just as well as

b)

|------10R---||------>

batt+noise-----------|

|-------R1--R2---->

V

|--10R------||------>

|-mcu---->

It seems to me though the main point is the normal small R5 is fine. The big R5 on the zener messes with voltage readout. You can keep the little R5 and add zener resistance elsewhere, next to the schottky. By instead using a tantalum cap and a resistor next to the schottky I was just tyring to avoid adding another resistor.

so the issue is zener needs this:

c)

|-------------||------>

batt+noise----5R--200R-----|

|-------R1--R2---->

V

|-------------||------>

|-----mcu---->

(zener not shown)

But now that 200R messes with voltage reading (arguably not as badly as I thought though) so you can either do this:

d)

|-------------------||------>

batt+noise----5R--------------|

|-------------R1--R2---->

V

|-200R------------||------>

|-----mcu---->

which requires an extra resistor, or this:

e)

|----------------5R||------>

batt+noise----------------------|

|-------------R1--R2---->

V

|-200R------------||------>

|-----mcu---->

which doesn't need an extra resistor pad if the 5R is included in the cap. However tantalum caps are expensive and without the usual 5R pad now everyone is paying the price for zener even if they don't use zener.

Option d for zener builds only, e for really tight zener builds, and simply option a for everything else seems reasonable to me. Let zener boards worry about zener board problems then. On the other hand I'm understanding how (a) (really c) works even for zener's now, just not 100% sure how stably it works.

I'm liking this asci art for discussion. For future use, here's a full diagram of the standard TA layout (minus the LED circuit) with zener, I've changed the 5R resistance value to simply the R5 resistor label. I've actually never seen the circuit laid out as a full loop before.

Batt+ Batt-

|--| |-----|

| |--------*<-----| (tail cap LED, shorted by switch)

| |---------/ ----| (tailcap switch)

| |

| |

|---------BR----------------| (case ground plane, not equal to batt- when tailcap led is on)

| |

R5 |

| C1 |

|---------------||----------|

| |

|-----------R1---R2---------|

| | |

| Vsense pin |

(Schottky) V |

|--------------mcu----------|

|-------------<(zener)------|

Vcc |--------------||-----------|

C2

Did I get that right? (The trick to spacing is to use format->formats->inline->code )

Maybe this view helps to see that if R5 is large R1+R2 voltage sense is affected by the current draw of every path to ground (except BR) which all pull current through R5 increasing the drop across it.

Bleeder comes off in wrong place, editing... Fixed

It is looking like the easiest option for the zener could just be to do it the old way and replace the diode with the resistor and not have a diode at all. Thus better be careful about how you insert batteries. There is no way another component is fitting on the 17mm drivers unless everything was shrunk to 0402 sizes.

Right now my biggest intrest is figuring out the C2 OTC replacement. That will make the biggest difference, the zener is just a matter of figuring out the best way of doing things. I could just simply take the voltage reading directly from the positive and skip R5 for it if all else fails.

When using C2 to power the MCU for OTC duty, will the MCU drain power through the voltage divider? I assume that we will need to raise the values to 47k/191k? Will that even be enough?

I think the main issue for C2 OTC replacement is finding a good enough capacitor. The X5R/X7R specs are only about temperature tolerance, they have nothing to do with capacitance over the voltage range. Many caps can have the the specified capacitance at around 1 to 2 volts, then drop drastically as the voltage increases. I was looking at a few caps and found this in the datasheet of a 47µF, 16 V, ± 10%, X5R cap:

It’s rated as a 47µF 16 V cap but at 16 V it has lost 80% of it’s capacitance, turning it into a 9.4µF capacitor. It’s only 47µF at under 1 V.

This was maybe the worst I saw, but still, finding a suitable cap at a suitable size and price might not be so easy. Definitely interested if someone knows of one though.

That was what I meant when I said that it needed to offer 2-6 seconds of off-time when “warm”.^

I suppose if worst came to very worst through hole caps could be used. Most pills would have space for them. Soldering them would have to be by hand and would not be easy though since I doubt they could actually go “though holes”.

I don’t think I will bother with it if it comes to soldering on “normal” caps. With LDO fed MCUs (both 1S and 2S) the voltage to the OTC will always be the same, and with temperature offsets there should be enough consistency. I don’t really need to free up the pin that much, but still it would be useful so I’ll follow with interest.