Attiny25/45/85 FW Development Thread

Seems like it sets things up so that if the different software or hardware (fet driver vs 7135 etc) puts the mcu in a different power draw state, then it's going to change the battery calibration. On the other hand, if we can avoid R1 sensing entirely I can come around to it. If we're stuck with R1 sensing... enh.. stil seems better for stability to move R5.

You do have a point about the LVP and the MCU current draw. It was pretty stable while I was troubleshooting but I was troubleshooting not testing for this.

Another option is to simply switch the diode and R5 when using it in 2S mode.

You would need both I think. You still need a resistor above the mcu and one in parallel. Sure you could use resistors for both, so long as they normally carry significantly more current than the mcu. I kind of like that, a) because the zeners are expensive, b) it regulates some (depending how much you over-current it, but then that removes the Vcc sense possibility.

Oh true, that works!

Actually, maybe not. I'm not sure how the C1 cap will behave in noise situations if it's on that side of the diode. Might be ok?

Why not use a 2.5V LDO like the MCP1703 (3 pin SOT-23A package) for single cell drivers? Once could then just get rid of R5, input diode and zener (if dedicated zener is present). The MCP1703 is smaller than those three components combined. It’s also available with 5V out so the same driver design can be used for 2S drivers.

Well if we will be upgrading C2 to massive sized will C1 really matter much?

This is a possible option actually and very possibly the best option. Cost wise it is only slightly more expensive as well.

What about C1, will it be needed with this? If we could eliminate all of those components and just have the LDO and C2 that would be something to seriously look into and a worthwhile upgrade. It would also make higher voltage applications much simpler as well.

According to the datasheet the LDO wants an input capacitor. This would be C1. I don’t know how it will behave without one.

I guess this idea won’t appeal if you really want to use VCC as voltage ref. Personally I have enough space to keep two 0603 resistors for the divider, and the divider could be useful if the OTC goes out the window. What I don’t know in that case is how to have a large enough “off-time MCU power source” capacitor without causing issues with the LDO which uses much lower valued output capacitors. Put a resistor between them maybe?

The LDO needs an input cap but what about the output, the cap to take over OTC duties would be after the LDO anyways. Would it not work like normal?

Do they not have any LDO IC’s with build in components to minimize external space?

I think that keeping the voltage divider might be the best plan and honestly using a higher voltage LDO and just using the same one for all voltages would be the easier option.

Could the 5v version be used with the normal 1s cell setup? Sure it would not be regulated but then it is not right now anyways. It would mostly be acting as a diode and decoupling resistor.

I don’t know much about these things. I just read the datasheet and it specifies both input and output capacitors. The specified max capacity of the output capacitor is much lower than a “off time MCU power supply” cap would need to be.

Maybe the LDO solution still needs a “traditional” off-time cap solution, but it would nice if it didn’t.

So if the voltage is lower than the needed input voltage, the LDO “lets it through”? Interesting, I would have thought that it just stopped giving any output. I didn’t check the datasheets for that.

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.