LED drivers and Accessories you want, but don’t exist

No, this is great! That should work. There’s enough space for that. It’s just around the MP3431, where’s nearly no room for anything more. But how does this work then?
Use the PB0 as voltage reference for the voltage divider? Is that possible, even if the PB0 voltage is higher than the Vcc voltage?

Ok, I better really double check my facts then. I'll post back. 90% sure right now.

Well shoot, kind of remembered I can't see how any pin can take more than Vcc, and... it can't. You can use a reference there, but it can't be higher than Vcc.

Ok, so what about sending, OTSM pin over to PB0, so divider voltage connects to both the OTSM pin and PB0? Or maybe it only needs to use PB0? Oh.. yes, I think that's true. Can do OTSM on PB0 and inverted reads at the same time on it! These little chips have so many tricks up their sleeves.

It’s just a few changes for me, so if you can do it, that would be awesome. But how does this work? How can it distinguish a low battery from a turn-off?

And how can I cancel an Oshpark order I already paid for?

Now that I can use 4 layers, maybe I can move some traces to the inner layers and have a little more space for other stuff. I won’t move that much though, vias need a lot of space as well, maybe even more than some 6mil traces.

Probably can't cancel. But you can build the board as-is and just set LVP kind of high for first testing. It will still work.

So I use LVP and OTSM on same pin normally for LDO lights, but that's 5.0V LDO with 2S batteries. The LDO never drops out then. Still the LDO is just the reference. The LVP is still on the OTSM pin. That's ok, so long as you can keep the voltage on the pin above 0.6*Vcc. Normally to run the ADC in the range from 0.6V Vcc to Vcc you need the reference to be high and constant, so a 5.0V LDO on Vcc works.

This plan is different. This is the one case where we can use a lower internal reference. The inverted read trick actually "reads" the reference voltage with the pin voltage (Vcc or Pb0) as the "reference". Then you divide the result. So that's another way the batt voltage can be left high on the OTSM pin and still be able to read it. The difference doing it on Vcc vs PB0 is on Vcc you can't use the OTSM reduced batt voltage for a couple of reasons (breaks the whole voltage separation and pin detection of OTSM) but on PB0 in this case you must use the OTSM voltage, and it's perfect.

Yes, all these voltage read restrictions and possibilities in general and especially for OTSM are dizzying.

So what you want to do with your voltage divider is aim for about 4Kohm total, and for a full battery, 4.2V to come down to exactly the LDO voltage.

By the way, I did notice a statement in the manual that says if the PB0 reference voltage is above Vcc-1.0, the ADC will get less accurate. So... not sure how bad that is. Might require more research. However it is specced up to Vcc. We don't need 10 bit precision.

GRR… drat drat drat. Still one more caveat I missed on that

:person_facepalming:

The external reference must be above 2.0V. Sigh. That still only gets you a dynamic range from 4.2V to 2.7V if your resistors are pretty perfect, assuming 3.0V max read (Vcc). I wonder what exactly happens at 1.9V?

Now I got 2.8V LDOs (TPS706), and with a good resistor combination, pretty much 3V is the minimum (if I understand it correctly). The combination would be 1330Ω and 2670Ω.

And, do I understand it correctly?

Hmm, well 2.8V LDO's are looking worse for option f, but they help option a.

Yeah, with a 2.8V LDO option F leaves you at about 3.0V LVP, you understand that right, assuming the 2.0V AREF floor is hard. But option (a) gives you 2.8V LVP or close.

Now I like option a) again. 2.9 V LVP isn't bad. I was worried it might push up to 3.1 or 3.2. 2.9 is ok.

OK, now from all the different options I’m a little confused. What do I need to do for option a) again?

Umm, don’t count on that. The whole substrate can be treated as a (reverse-biased) diode, and hitting one pin with reverse voltage can essentially apply the whole battery voltage through that one pin and out one/both power pins.

Same danger with applying an input voltage to a pin higher than Vcc.

I think that's true if it's not tri stated. My experience with these little buggers is they are tough as nails. I don't in principle yeah giving negative 3V to a tristated pin is probably beyond spec, but I'd guess it survives it. I'm pretty sure I've done just about every bad thing it's possible to do to things with 4.2V several times, and not managed to harm one yet. Although most of that was brief contacts.

nothing. And I probably confused you, I meant a) and I think g) (not f) the last one we were talking about, that probably never got a letter. Anyway, a is the leave it alone option.

The concern with a) and a low LDO is OTSM performance being poor at that low of a voltage. But you're just running up against all the limits. If the LDO is higher, like 3.0V and you use option G to get LVP lower, the boost still won't control quite right at 2.7V, although, that's probably pretty minor. It will still control, just start dimming a bit.

I think you should give option a shot and see how it works out. You've already got the boards coming anyway. I'll package an OTSM debug hex for you so you can test OTSM timing on it. Oh yeah, reflashing isn't exactly easy, well that's the price of the qfn.

Getting info from avr freaks on the 2.0V AREF limit. Looks like there's a little cushion beyond that in practice, but it does eventually quit working, in the right direction though.

Update: So by spec the absolute minimum on any pin is -0.5V. Indeed reversing the battery would be out of spec on any pin. Actual damage is still up for question. Well, I may as well just test it. I figure if it stays under 40mA it should be ok, so I'll crank it down slowly and see what happens. Lightbringer's point make sense though. It's like if the pcb board becomes conductive, the resistors don't matter. Bigger problem is I guess I should desolder 7135's first. You squint the wrong way and those things go belly up, at least mine do.

If the order has not been sent to fab you can email them at support@oshpark.com and either ask for cancel or send them new updated gerbers. I’ve done both quite a lot. They are very flexible up to the point when they are sent to fab, then it’s too late.

Glad to hear from you.

In the end, nothing had to be changed, so I didn’t need to cancel my order. But good to know. I think about making another version of the board, where just the pwm signal is connected to the LDO. Not sure if it fits though, need a diode and two transistors for that.

Back in town again so to say… Was a nice computer and internet free two month climbing vacation, but now back to reality…

I have those boards based on the GXB17 design waiting for some attention. Before I dig into them, how have things been going with 17mm single cell boost drivers? Are there any readily available and tested boards yet? In other words, is the GXB17 design obsolete?

Not tested, and not readily available, but I got some boards on the way, already have the parts.

Sorry to ask, you’ve probably addressed these questions earlier in the thread.
I see that you are not using the same boost IC as the GBX17 design. May I ask why you chose this one?
What kind of max output are you aiming for?
I don’t see a digi-pot in schematics you have linked to earlier in the thread. How will you control modes/output?
If your design works, would you mind if I rip it off and make a ATtiny1634 based version of it? I don’t use any other MCU now days.