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

476 posts / 0 new
Last post
Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Is there a standard board or clamp or something you can buy to flash that or are you making up a flashing board too?

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

I use a USBasp and small wire that I solder on to flash it, for now.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

You need 5 wires to flash.  (power, ground, miso, mosi, sck) You're soldering them all by hand?  Wow.

 

At some point it would probably be worth drawing a flashing board, that just connects via headers to the chip. It's got to be faster to just reflow it. Of course that requires work too.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544
Lexel
Lexel's picture
Offline
Last seen: 9 hours 34 min ago
Joined: 11/01/2016 - 08:00
Posts: 4897
Location: Germany

So this is a buck driver?

If this works it would be nice to try to get one with Narsil

Also thought about a driver with a slave board to get more useful space

To solder and unsolder 5 wires for programming takes a minute, nothing wrong for a small to medium number of drivers

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

I don’t need the reset pin to flash?

It’s a 1S boost board.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

oh, yeah, forgot reset.  Yes you need that too.  6 pins.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

So for testing it's actually possible to flash with debug wire, using only 3 pins.  Two of those are power and ground.  One is reset.  So you could solder a wire to just reset on the board if you leave a small pad.

 

BUT, that uses debugwire, you'll have to flash fuses for that first anyway, and those fuses disable power-down sleep, which means OTSM won't work, so, so much for testing really.  Could be useful for rapid e-switch testing, but not a very viable all around replacement.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Hey you still never told me what Vcc is powered by or I didn't understand.  I need that to figure out LVP.

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

Just look at the PM, I sent you a picture. If it’s too small, open in new tab. LVP should be 3V or 2.9V.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Just simpler to ask.  Ok.  So that's a bit of trouble. 

 

No time to explain right now, probably it will require LVP set at 3.1V, or high enough for tolerance to stay above the LDO.  I'll explain later.  OTSM has constraints on LVP and this doesn't fit the usual solutions very ideally.

 

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

So a little more detail.  The issue is that to use the divider for LVP, the divider voltage must be kept above about 1.8V, (brushing over the details) to prevent off-click detection.  To do that you need a high voltage reference to compare the voltage pin to.  A 5.0V LDO on Vcc works well for that.  3.0V doesn't work as , more on that in a bit.

 

So for 1S builds, instead HD reads voltage from Vcc.  But in that mode it's actually reading the battery voltage from Vcc, not some regulated LDO voltage.  There are only two pins where the battery voltage can be read as a higher value than the internal reference used, those are Vcc and PB0 (only Vcc presently implemented in software).  So that works for 1S with no LDO.

 

Now back to your thing.  You can use the first method, but the problem is the voltage reading stops working once the battery hits the LDO level, or possibly slightly higher (some dropout in the LDO, not sure how much).  Once the battery starts dropping below the LDO the sense voltage on pin7 and the reference voltage on Vcc start to drop at the same speed and the ratio doesn't change, so you peg the bottom of the scale there.

 

a) So this could work, but you'll lose sensitivity somewhere above the LDO voltage and must set LVP above that.  You will also probably need different resistor values for the divider.

 

b) One suggestion would be to instead provide battery voltage to Vcc. You only need the LDO for the voltage filter not for Vcc.  However, I'm guessing the reason you aren't doing that is that you don't want to use a separate protection diode.  Speaking of which, you better use an LDO with low reverse leakage.  I think the ones used on the small TA boards have worked. 

 

c) Another possibility is to find an LDO that will work at 2.5V, but there's another problem you're running up against.  OTSM doesn't have as much extra headroom at low Vcc.     2.5V may not work well at all, and/or may require more attention to good hardware selection as far as the cap and the leakage of the LDO. It could work though.  My specs are a bit overstated, and exactly so that things like that might just work.

 

d) Yet another possibility is to make a hybrid voltage readout.  So that it uses both Vcc read and Vcc referenced divider read.  Vcc read will remain constant until hitting the LDO voltage, then it will drop and you can get extra range from that.  From a software perspective though that could be tricky, because the way bistro polls the ADC, changing references requires delays, and there's already a switch back and forth from voltage to temperature and some difficulty orchestrating the timing for that.  That's not my favorite solution.

 

e) Yet another option is to use a separate pin with a separate voltage divider, but I'm pretty sure you have no space for that.

Agro
Online
Last seen: 2 min 45 sec ago
Joined: 05/14/2017 - 11:16
Posts: 3819
Location: Ślōnsk

Thanks a ton Schoki!
Lexel, I know it’s too early for a definitive answer, but what do you think about making a run? Smile

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Ooh, just had  another option come to mind. 

 

f) Send battery voltage direct to PB0.  I don't think anyone has ever used this trick, but the "internal" or "inverted" read method can be used on PB0.  This does cost an extra trace but doesn't cost a diode.  Why?  Because it's a high impedance pin, unlike Vcc.  It shouldn't need reverse voltage protection.  Still not a free solution solution though.  We were already out of room for a second PWM trace as it  was.

 

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

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?

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Schoki wrote:
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.

 

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

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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.

 

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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.

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

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.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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. 

 

 

 

 

 

 

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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

Facepalm

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?

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

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?

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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.

Schoki
Schoki's picture
Offline
Last seen: 5 days 15 hours ago
Joined: 03/27/2017 - 15:34
Posts: 210
Location: Germany

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

Lightbringer
Lightbringer's picture
Offline
Last seen: 2 hours 2 min ago
Joined: 08/30/2016 - 14:12
Posts: 7744
Location: nyc
Flintrock wrote:
This does cost an extra trace but doesn’t cost a diode.  Why?  Because it’s a high impedance pin, unlike Vcc.  It shouldn’t need reverse voltage protection.

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.

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

Lightbringer wrote:
Flintrock wrote:
This does cost an extra trace but doesn't cost a diode.  Why?  Because it's a high impedance pin, unlike Vcc.  It shouldn't need reverse voltage protection.
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.

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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

 

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.

 

 

Flintrock
Offline
Last seen: 1 year 3 months ago
Joined: 09/10/2016 - 20:29
Posts: 1544

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.

Mike C
Mike C's picture
Offline
Last seen: 15 hours 4 min ago
Joined: 01/22/2014 - 08:03
Posts: 2255
Location: Sweden

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

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.

Pages