Attiny25/45/85 FW Development Thread

Don’t know the correct terminus. I was talking about this “old” Elkos (electrolyte capacitors?) with wire connectors (which I used in my test board since I have plenty of them here for decades).

Wow, very impressive results, I love it! Finally no more hassle with OTC calibration and constant results!

So to be clear, lets take the TA driver setup:

You are putting the 47uf or 94uf in C2 spot and removed C1 in your testing? Otherwise things are basically the same? So no changes needed to the layout?

What about the OTC cap, can it simply be removed and the voltage signal taken from the voltage divider? Or does it still need a dedicated pin for the power cycle?

If this can be implemented into Bistro, as a definable option preferably, I totally want to tweak the Texas Avenger designs to use this going forward. This seems so much better.

You can get 47uf for cheap: https://www.arrow.com/en/products/cc0805mkx5r5bb476/yageo

100uf costs a bit more obviously but still possible. Although 1.5 seconds even at low voltage should be enough. Even in bistro the long press is setup for 1.5 seconds and nothing is setup for longer then that, although I am sure we will come up with something.

With some tweaking it is possible we could even extend the time with the 47uf a bit longer.

Although if the power cycle could share the voltage divider even at the cost of a bit less “running time” that would be ideal.

Ah, through hole caps. These are possible but a pain to use in most drivers as they have to be hand soldered instead of reflowed on a very tight space. If nothing else was possible it could work. Although I know I would personally rather spend the extra $.50 cents and get 100uf 0805 caps to make install much easier.

We somehow got off the trail on this I think, myself included. The whole reason 2S needs 2.56V ADC setup is possibly to keep the sense voltage above some digital trigger threshold since the ADC sense is dual purpose with the shutdown sense. However the whole reason 1S doesn't have that restriction is because for 1S voltage will be sensed an entirely different way anyway. So yeah, it's different software, but that's not a new discussion. The ability to move 1S to comparing internal reference to Vcc has already been tossed about. My point is I think there's actually no need to have software for two adc sense voltages, just two different adc sense methods. What it means is divider sense voltage reference may move to always 2.56 or to the Vcc trick, but then never to 1.1.

There might even be a clever way to auto detect the two situations, and/or hardware signal it. Example for internal 1S measure mode, set up the driver with full vcc to the divider sensor (R1=0ohm). Detect it in software with: If external adc=255 then use internal sense mode. There might be a situation if V drops low, I doubt it, but an: "or if Vcc <2.8V" or so would catch it.

A very rare exception where none of this works would be the new buck driver if it ever gets used in 1S, because it needs an LDO even in 1S. So there's always exceptions I guess.

but what do you have against tantalum 220uF?

http://www.digikey.com/short/3bndd8

Well, ok, the voltage rating is pushing it actually. Spec sheet says it can handle 4V up to 85C and 2.7V up to 125C, linear decline inbetween, so that in theory specs up to around what 110C or so at 3V. I can't imagine this thing getting that hot. But it is pushing things a bit and really only suitable at all for LDO setups.

Mostly the price and voltage limit on that unit, $1.74 is a little steep but it is an option if cheaper options do not pan out.

100uf looks like it will be enough can can be had for almost half the price, with better specs as well.

Although I really do not care what is used, as long as it works reliably.

The real question for me is can this be combined into the same pin as the LVP and not need any changes to the hardware. If so then this just keeps getting better and better.

Yeah.. I withdraw that suggestion.

I really thought I could find better than this though:

http://www.digikey.com/short/3bn0mj

but at the moment I cannot.

Ok, this is a bit better:

http://www.digikey.com/short/3bn09c

That is the plan, and the point of my discussion above about ADC reference (which might not be 1.1V as standard much longer). I wouldn't see why it couldn't use the same pin so long as voltage is kept high enough on it.

Yeah, that second link is the one I spotted as well. Although if the 47uf can handle 1.5 seconds that is a good starting point at 1/4 the price. It is a simple part to swap out later if we come out with some feature that needs more time.

Or if combining the LVP and off time counter onto the same pins uses more power, then 100uf could be the way to go.

Shouldn't unless high C1 is needed and slows the shutdown too much.

That’s right. But I wouldn’t remove C1 from your layout since it will be required probably in some setups. C1 might give some problems since it increases the time until the mcu detects power off state. More tests required.

I didn’t build a voltage divider in my test setup, so yes, I used a dedicated pin for power down recognition.

If it is possible to use a level change interrupt for power down recognition it might be possible to combine it with the voltage divider. If not, and if a power down event falls into a ADC measurement, it might take too much time until the firmware can detect this and is able to power down the outputs and ADC. Fast reaction is crucial. It has to be tested if a level change interrupt is fired during ADC measurement on the same pin (probably yes) AND if we can use the watchdog interrupt and power down state within the level change interrupt function. I tried this way first but the watchdog didn’t wake up the mcu within the level change interrupt function - but it was only a quick hack and could easily be wrong programming on my side.

I regret I won’t have much time for further tests next days.

I'm having trouble seeing how the lighted tailcap can be compatible as is. We need voltage shutdown. The lighted tailcap needs it not shutdown.

The lighted tailcap takes the power from before the MCU path, it should not have any effect on the MCU power usage as the diode will block off all reverse current.

The tailcap would cause issues with OTC timing though (the theory was that it was pulling power through the MCU/OTC to power the LED’s). So without an OTC it should not have timing issues anymore.

Never used the lighted tailcap. Is there a circuit diagram?

I am not aware of one per se. Although if you look at the diagram I posted earlier the BR (bleeder resister) is what sends power to the tailcap.

Very simply really, it simply allows some leakage current to flow back through the body to the tailcap when the switch is off. This then powers the positive side of the tailcap which has another resistor bypassing the switch to ground to give you the power you need to light up the LED’s.

Yeah I’m more of a hack than an engineer, I can’t understand diagrams very well so I don’t make them myself.

In the tailcap there is simply a resistor (or pot) and an LED in series, both parallel to the main power switch. So when the clicky switch is ‘off’, a small amount of power flows through the tail LED.

On the driver there is a “bleeder resistor” that bleeds power form Batt+ to the battery tube, completely bypassing the driver. With the right value bleeder, I’m sure the MCU sees some voltage but not enough to boot up or keep an OTC charged.

It’s all very experienced based as far as how it works, I’m not sure what other things influence the operation.

edit: This is the closest I have made to a diagram. I used the “ground” symbol to refer to the flashlight body. It also doesn’t show any bleeder. You get the idea. This is from the original discussion thread Feb ’15

Even 6,3V for a cap is a very, very low voltage rating for these drivers…

@pilotdog68:
Thanks! What are the common resistor values?

It depends on the Vf of the LEDs chosen, how many are used, how bright the user wants them, etc.

For the bleeder, I normally use 1kohm, others use more like 560ohm, The highest I have seen work while maintaining normal driver operation is ~2kohm.

For the LED resistor, I don’t know for sure because I use a potentiometer usually, but I would suspect between 50-100kohm (I use 100kohm pots)

Why do you say that? C2 is behind the diode and R5 decoupling resistor in the latest designs. 6.3V gives a quite a bit of margin for error (it should never seen more then ~3.9V in theory). Or am I missing something?

Even for 2S operation the zener is before C2 and as such would keep voltage from going over 4.3V.