Attiny25/45/85 FW Development Thread

Actually I keep lousing the measurements when in a hurry. It seemed like those were fast seconds, but I made up for it by going to 500ohms. 1.25S at 3.1 V, I think that will still work out, but I was looking at 47uF caps in more detail and man, those DC voltage vs capacitance curves for 10V and 6.3V caps (only ones available in 0805) are nasty, so it will need testing with a real CAP (but a v-chip can still help too). Also I wonder what our rules are. TA you're the driver arranger. What are you interested in trying here. I'm betting that adding capacitance to the traditional OTC slot helps almost every bit as much as adding it to the C2, but I'm not sure. Possibly matters how pin states are set (something I haven't understood or played with enough). It depends if we're thinking new boards or just keeping the ones you have. If keeping them, might as well use the spot. Then you can get 100uF anyway.

I think 5.0V LDO is a much better choice. 5.0V gives you much more off-time power. PLENTY in fact, but 3.3 is down on the low end. Of course we want it to work at 3.3 anyway, but's no need to cause issues for people with multi-cell lights and lousy caps. More importanly I'd like to keep the resistor divider simple, so two equal resistors for 2S, no divider for 1S, two to one for 3S etc. If you have a 3.3V ldo, you can't put 4.2V on the sense pin, it's way past spec. You can only go to Vcc +0.5 V. So that makes resistors more complicated and at the same time reduces the margin for error in them before hitting the cuttoff voltage. There's enough margin, but then you really have to get it all right. With 5.0, 2-S, just use any two equal resistors and you're set. 5.0 would also allow auto detect but that's not going to happen in a 2048 byte bistro anyway.

Otherwise, setting this up for multi S won't be a big deal. Forget tailcap lights for right now, I'm too lazy at the moment to think about them, but without that and with a 5.0V LDO, you just need to divide the voltage by two for two cells. If you want to skip a bleeder then you'll want the total R1+R2 to be low and within some window, but there's still a ton of flexibility there. No more of this 19.1 vs 20 vs 22 nonsense. That won't matter, so long as they're both the same and both in the right ballpark (I'd say two 250 ohms each is looking pretty good). You could instead have them higher(but still equal) and use a 500 ohm bleeder, but it's probably completely unnecessary.

As for the software, it's just one config option and getting the right calibration table in place, which will depend on the LDO voltage so best to choose one and stick with it.

At the moment I'm using no R2 resistor for 1S. That's probably fine and even R1 could be shorted, but to bring the voltage down slightly farther into spec a 10x R2/R1 would be ok too (so backwards from the past). It probably really doesn't matter though.

For the first question, I assumed from the start that a PCB change would be needed, if it works with the stock setup that is great but a change is what I saw coming. Although at best on the current TA design it might fit an 0805 cap, I don’t see a 1206 fitting but since these would be hand made anyways you could put a 1206 on the 0805 pad.

Overall the number one goal is to make it as universal as possible with preferably only voltage divider changes needed for different inputs ect. Also needs to be able to work with both clicky and e-switch.

The reason for the 3.3v ldo is that for the opamp to work it needs a reference voltage which it gets from the LDO output. at 3.3v the circuit will work fine till it drops out of regulation around 3.4v or so, then the driver current will start dropping due to the reference dropping. This is fine at those low voltages since it would not be able to maintain full power down there anyways but a higher voltage LDO would be a different story. This is another case of a compromise that has to be made in the interest of space and cost.

The LDO could be swapped out for a 5V LDO in 2S setups with resistor changes all around but I would prefer to only have the voltage divider change for simplicity sake.

Oh well you're talking about an op amp driver now. That's a whole different story. Are you abondoning the tripple driver entirely?

Anwyay, both will work. We can define choices. In 1S it doesn't matter. In n-S you can use 5.0V and matching resistors, or 3.3V and some well selected resistors as before, with lower maximum off-time calibrations. It's up to whoever is setting it up.

As for using the existing hardware, for 1S I think this will work other than we'll see about capacitance. The C2 is now 0603 so no cramming 1206 on that. Might be possibly on the OTC pad though, and as I said, I guess that will still buy time too. I'll test when I can. A 100uF 1206 will hit this thing out of the park. The BODS does make real gains. We won't need 200 real uF's to operate it. I'll try really low resistance soon as that will simulate what a lower C1 would be like, so I'll see how much that matters. I don't think realistically we can go below 500ohms and stay compatible with tail cap lights. Also the drain starts becoming a little meaningful in moon mode at some point down there, but I can test at 50 and it's the same as using a lower cap.

I'm not sure about just aiming at hand made though. It seems some of the software has showed up places like GB hasn't it? So there may be copies if it's made to be reasonable to build, and that's great.

I did forget about the need for a diode and LDO (or combo) in 2S, so yes, that probably needs a board modification.

Not really giving up on the TA series as moving on to better things. There is just not much left to do with the TA setup besides possibly cramming an 0805 C2 on it and frankly the TA will never go anywhere past hand made drivers (at least not the 17mm version, the larger versions could I suppose), the backside 7135’s just make it impractical to use it in a production light.

The new driver will be designed from the ground up to be production ready, which is why I am moving the focus to it. Plus it is simply a better setup and even more efficient then the 7135’s since you can have true non-pwm regulation at any current that it can dissipate the heat from instead of just 2 channels of pre-selected current.

So While they should share the same firmware setup I am moving focus to the new driver. Anything that works on the new driver should be backwards compatible with the Texas Avenger but not necessarily the other way around.

One reason I want as few changes to the hardware as possible is that I do see these drivers being produced by a china company in bulk for a cheap and effective option for us modders. As such I want the hardware to be as complete as possible for as many setups as possible out of the box. The voltage divider is the one thing that I don’t think we can get around but luckily that is a fairly simple item to swap out and/or disable in the firmware. I suppose we could always go back to the 1.1V reference for the LVP? or will that not work with the OTSM?

The new driver will always use an LDO with built in diode.

The TA driver will be able to do the same.

So the one issue there, is for OTSM it's a bit of a bummer to see a 1S forced to a 3.3V LDO. I said we need OTSM to work at 3.3V anyway, but that's not quite true. It needs to work at 3.3V but for a standard 1-S setup it doesn't need to work there hot. You just can't get as hot at 3.3V battery as at 3.9V anyway, so a 3.3V LDO is actually placing more demand on the OTSM cap. Especially in the TA driver, there's just no need for the LDO in a 1S other than conformity, but it might turn out it's better to use generation 1 in that case anyway. Well I guess for the TA there's no downside, other than maybe a few cents in price, to just using the 5.0V LDO for 1S, so that works too.

Like I said, the op-amp needs an LDO for the voltage reference and there is not enough space for a separate diode. Plus it would be nice to have everything setup around a single LDO voltage, then no changes would be needed for any input voltage outside the divider.

Well I'm going to have to order an assortment of caps for the sake of science and maybe even build a light. I don't like the power saving I programmed in bistro now. It's too unreliable with 16ms minimum watchdog idles. It needs 1ms resolution to make sure it's always engaged when you need it. I think I have code for that too using the internal clock timer, but it's a few lines longer and it would help if that other space savings trick works out.

I don't see any downside to recommending 5.0V LDO for 1S TA (non op-amp) style. It comes in both flavors probably no? Does 5.0V require a substanitally different part or it's just a choice in the series? If building a 1S tripple, I'd just buy the 5.0V and use it as if it's just a diode. Actually, I'd use the 1st gen board at the moment, because I know it works, but assuming the LDO works out (and does actually act like a diode), then 5.0V for 1S, and well, for tripple drivers also for multi-S. Yeah, 5.0 V for any TA tripple. Sure if you ordered a bunch of 3.3's for other builds they might work ok too, but you usually know what you're building when you buy the part. 1S op-amps are a different issue. I'd use whatever is best for the build. It's the same effort either way.

You can use a normal diode on the TA drivers for 1S operation but like I said, I am not worried about them directly. Anything that works on the new driver is backwards compatible. So all development should be focused on the new opamp driver as that will be the long term winner here.

I can’t really think of a reason to use the TA series anymore once the opamp is working as it should, while they basically do the same thing the opamp will be the better one to use due to it fitting in lights easier and being more adjustable. Plus it could be machine made for group buy lights / cheap mass produced driver option compared to the TA series which would not work well outside hand built setups.

This is the driver planned to use in the Lumintop SD26. I took a 30mm LDO and converted to std diode setup. I think it would work. I added a wire jumper and a 0 resistor to make the connection of Batt+ to the MCU and C2. If anyone gets a chance, can you review/comment? Thanx!

Basic parts:

It should work like that. I think I actually said in the TA thread that you could put the diode across the far inner set of LDO pins facing towards the MCU and it would work fine.

The way you did it would be fine as well though, same thing, different placement. Although I did figure out a way to remove those jumpers but can’t bring myself to update all the drivers with the minor change when I have a new driver in the works that should render LDO versions of the Texas avenger moot.

K, thanx!!

Oh regarding the 1.1V, no that won't work with this bistro OTSM implementation, unless you want to make a separate pin for power-off detection and voltage divider. Presently the divider voltage needs to be logic high. For 1S the only practical way to make that work with constraints on the ADC is to use Vcc "reading" , and then for 2S use Vcc/LDO-referenced (not 1.1 or 2.56) reading of the divider. It will just be a define to switch.

It's certainly possible to make a purely ADC-based implementation. It's a rewrite of bistro's adc system, not just changing a couple of initialization registers or the name of an interrupt. It won't perform quite as well either, maybe a little because the ADC uses a little more power on these BODS scales, but even more because you lose the possibility to wake on the power-on signal. Instead you only wake on the watchdog timer, which, to save power in BODS, is presently set to 0.25s intervals and is thus too un-responsive. You'd need to lower it to 0.125s at least, requiring maybe 50% more power draw in the sleep loop and still being I think noticeably less responsive (based on my non-thorough observations of that setup). So I'm not really seeing that as the direction to go in, but it could be something to try.

I'm not sure how well the 3.3V 1-S Op-amp OTSM will work though. It's all going to depend on the quality of caps we can find. There seem to be options in things other than ceramic, but anyway, it just needs searching and testing. Specifically leakage should be less than 1<uA, and that doesn't really fit with specs on Ta Ta-Polymer, NbO, but comments I find are that real world results are much better than spec.

Worst case a 5V LDO could be used in the higher voltage drivers, it would remove a lot of the point of having these mass produced though if that was to happen. The sales pitch for someone to mass produce these is that they would be the one size fits all driver for anything.

Good news is I've saved a TON of space (by attrition mostly). This is presently looking like it will be even smaller than the last version. The bad news is I'm presently noticing that it's not working well (or maybe at all) on high modes. I'm not certain if that's something new, or just something I hadn't noticed. Hmmm... something to try to understand still. Obviously that would be no good.

well.. ok, not smaller than the last one, but still 140 bytes left over for now.

very nice, the more space the better, we will always find a way to use it!

Yep.. Anyway, high is working, just not well. hmm, hoping it's a pin setting thing. Not sure. Mostly I haven't used turbo because the star isn't heat sinked. So will have to figure this out. The led shouldn't be able to drain C2, and if anything should help. Well I've got at least one idea to check so we'll see.

I don't know the cause of the high mode thing yet. Haven't had a chance to do any testing. I realize that one thing my power measurements missed, well that's the wrong word... they measured the mcu power draw. But there can also be a reverse current through the diode (I was feeding power forward through the diode so didn't measure that). I checked the specs on the diode in your digikey basket (likely the one I'm using, but I'm not sure) and it's not very good:

http://www.diodes.com/_files/datasheets/ZLLS410.pdf

At 25C it's around 1uA or less but at 85C it's around 80uA maybe. I wouldn't think my board is getting this hot (not sure, it's hanging in the air without a case to heat sink too, but it also has no led to heat it up), but it would only have to be 5ua to have the kind of effect I'm seeing. It's another case where I don't know how conservative the specs are. If it causes this issue or not though it's probably not ideal anyway. This would be a better choice I think:

http://www.onsemi.com/pub_link/Collateral/RB751V40T1-D.PDF

With the graphs indicating around 1uA at 85C. That diode is a bit fragile in comparison but should do the trick (with an R5 installed to protect it).

Of course all this brings the question, how good is the LDO at reverse current blockage? I lost the link to your new LDO. uA are small. Can it really work without an inline diode?