Abiding by the USB 100mA, 500mA rule

Struggling to meet strict USB current-draw rules.

Some of the problems start with small TI buck and boost converters that use the Peak Current Control method, with the input current always ramping up to a high maximum value. Multiple converters run from the supply, and capacitors C1 C2 = 100uF try to average the current to under 500mA. Schematic:

formatting link

Connecting 100uF to a USB 5V line is like a short, and can trigger a port shutdown. U20 sources 100mA until C1 charges to 4.55V, in about 5ms. Next U18 starts 3.3V supply U12, and wakes the CPU with F1. U19 executes 320ms wait, during which time the CPU should achieve enumeration permission to draw 500mA. After the 320ms, U21 is added to reach an allowed 450mA draw, and the U5 battery charger is turned on. I see now that U19 timing, etc., should be handled by the CPU. It's a 48-pin part with all pins used, but we really need its management in this case.

--
 Thanks, 
    - Win
Reply to
Winfield Hill
Loading thread data ...

Did you have a question?

You say you see the concern of using a fixed delay rather than letting the CPU control it, but you are out of I/O pins on the CPU. F2 is listed as an input to the CPU. Where does it come from? It looks like U12 is enabled by either F1 or F2. I'm wondering if there's a way to change the way they work and free up an I/O pin. What voltage is the CPU running on? If it's the LDO, U12, do you only need to provide one of the two to the CPU? It wo n't run unless at least one is up.

Maybe an input can be tristated to combine these two signals? Use tristate buffers or just transistors. When F1 is low it's driver pulls down. When F2 is low it's driver pulls up. Otherwise the input to the MCU floats and the MCU can pull it up or down with brief pulses to test. Or use a pair o f resistors to set the voltage to a mid point and measure with an ADC. Har d to imagine a 48 pin MCU without an ADC. I'm pretty sure there's a TTL qu ad tristate buffer. Likely to be a tiny gate part with just one or two in a SOT-23 or an 8 pin package.

SN74LVC2G241 and SN74LVC2G125 seem virtually like the same part. $0.08

--
  Rick C. 

  - Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

Thanks very much for your comments, that's what I was looking for.

It comes from a zero-power general ON/OFF flip flop. When the flip-flop is off, current drain is under 1uA.

Actually, the CPU samples the two flags and other inputs by momentarily setting outputs to inputs, using "no pins".

Good point, be it's slightly useful to know if both are up, and the inputs are free.

Snip other good comments. Finally I decided to ditch the entire follow-the-old rules scene, and specify the instrument be powered from common USB charging modules.

And I decided to grab two output pins by degrading the functionality from 18 channels to 16 channels. Now the CPU controls charging and power timing, and it's much sensible. This drawing also shows the ON/OFF flip flop.

formatting link

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Not sure how you will feel if I suggest the schematic diagram is not so eas y to read for most people who didn't create it. There are many aspects tha t have to be "decoded". One is the use of inverter symbols for transistors . It would be most helpful if open collector symbols were provided, but wh at's wrong with drawing transistors? I guess you don't want to bother with the resistor details. Then the OC symbol would be useful. It would also be useful if it were a PDF with searchable text rather than an image. Wher e is the other end of Vin or the other part of U18?

Mostly it is the congestion that makes it hard to read and follow the flow. This second design is easier to follow than the first. Some others post schematics that look like a couple of op amps on a B sized sheet with so mu ch white space the full drawing can't be seen while also being able to make out the text even though it's only a few parts.

Otherwise not much to comment on except to ask about the power indicator. Is that a blinker that can be turned on solid by either the power switch or the CPU? Looks like it will blink on very briefly and off for around a qu arter second. It is off only when there is no power? Why does the power o n signal F2 drive the indicator through a cap??? I'm not getting this at a ll.

I'm very surprised the charging chip and the output regulator can't be foun d in a single device along with the input voltage level detector and variou s other circuitry. It's not like no one designs these sorts of application s in quantity.

--
  Rick C. 

  + Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

Yes, I agree. I added little oc to the BRT (that means bias-resistor transistor). The IEEE symbol is much too complex to render in a small component symbol. I used to add a vertical line, at the inverter triangle apex.

OK, I have put up the entire schematic, which is a searchable pdf. But I'm afraid now you'll really roast me over the coals, for a complex drawing, with lots going on and even more to decode.

formatting link

The full schematic shows these aspects. U18 is powered from Vin, which is higher than 3.3V, but thankfully U12's enable allows that.

Yes, and spread the drawing across six pages, in which you have to search every label, to find out what's connected to what. I like having it all available, even if it gets a little crowded. Haha, I've noticed many of my designs keep expanding until the page is filled up. Once portions get moved to a 2nd or even a 3rd page, the whole thing starts to get unwieldy.

Correct. Unlike most designs, where the OFF state has the CPU still running, in my design, when the U14 toggle is OFF, the power really is off, with a draw under 1uA. That way an OFF device can sit on a shelf for a year, without discharging or otherwise abusing its battery.

After turning on U14, the CPU can run at 32kHz, drawing 20uA or so, and an indicator is needed so the user will know it's "on". The LED flashes at a 2% duty cycle, drawing another 20uA on average. It can operate for months in this standby operating state, but we expect the user will notice the flashes and turn it off. When the instrument is busy working, maybe drawing hundreds of mA, the same LED is on continuously (E3 and Q9). Another LED and a beeper will also be indicating what it's doing and how it's progressing, or when finished.

Hey, I'm proud of that little addition. When you turn on the device, should you have to stare at it, waiting to see a brief flash? No, instead the LED instantly makes a longer, easily-noticed 22ms flash (4.7uF*47k), before continuing with the more brief 5ms flashes. One thing with the prototype, will be to optimize the LED indicator timings. The part values are place holders.

Yes, maybe. I'm fearful of poorly-cared-for Li-Ion batteries. The MCP73841-4.1 had all the features I was looking for, including thermal monitoring and shutoff. Another aspect in my parts searches was package size, and U5 comes in a small MSOP-10. Many charging controllers come in much larger packages, but it's possible there's a perfect part out there, that would replace much of the rest of my circuitry, and in the end take less space. Maybe. Sigh.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

3D0

Once I spent more time with the schematic I noticed the BRT label and also realized you have a miniature resistor on the input which is also a clue. It was when I saw all the pin numbers were 1, 2, 3 I realized something was up and checked the data sheet. Still, I think I would have just used a tr ansistor symbol.

No roasting. I accept your disease. It's not the complexity, it's the den sity which causes a loss of the very useful graphical clues to grouping and flow. Just as in writing code, the white space directs your eye to the le vels and structure of the code, white space on a schematic provide informat ion about the logical groupings. The orientation gives clues about the flo w either electrical or logical.

I have no complaints at all about the details provided. I try to do the sa me thing, it's like a reduced version of the design notes.

That's the ultimate problem. A complex design is hard to represent simply.

I just now see the other clue they are transistors, the label Qx. Another casualty of the drawing density and lack of white space. The PCB I have in production is so tight the ref des are all jammed in around the parts and it's hard to tell which ref des is with which part. Basically the ref des now only serve as land marks and you need a drawing of the PCB to find anyt hing.

The LED driver circuit is a great piece of work. So the MCU is on any time the power is on? Why can't the MCU then just toggle the LED directly? Th e three states are, all power off, power on-CPU at 32 kHz, power on-CPU at full speed designated by no LED, flashing LED and on solid LED. That shoul d be very easy to do in the MCU software without any of the U15, Q8, Q9, et c. But maybe I'm missing some info or feature this circuit provides.

Yeah, I see that now about the cap.

I appreciate that you consider this constructive criticism. I was a bit wo rried on my previous post that it might not be well received.

I know how hard it is to find the right parts. Very hard sometimes. That' s one of the good things about this group. Lots of experience.

--
  Rick C. 

  -- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

Hi Win, Sorry to be a few days behind seeing this thread. If you can ensure the payload current is initially below about 50mA until well after the bulk cap is charged then the 500mA inrush limit can be enforced by quite a simple descrete circuit:

piglet

Reply to
piglet

I'm using Fairchild's FPF2125 for input current limiting. Originally I had jumper settings for < 100mA or 450mA. But I threw in the towel on meeting the 100mA rule, and changed the low value to 450mA, and the high value to under an amp, or more. My spec will be to use a phone charger, etc., with the micro-USB cable. When it's run from a computer, for development, etc., either it'll be allowed 0.5A at startup, or if not, start the instrument from the battery, before plugging in the computer.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Yes, I am sure the FPF2125 is the proper way. I am wary of sole-sourced parts, was burnt once when product started selling big and then key part went to 99 week leadtime!

piglet

Reply to
piglet

I'm working on a power fail alarm for a ventilator project and I'd like to use some of your ideas. The alarm needs it's own power source obviously. Instead of using a small battery, I found an indicator with low enough curr ent that it can be driven from a supercap. I'm thinking it will be simpler to charge that up than a battery.

I was going to use a linear regulator with a current limit to charge the su percap. The ADP121 looked good until I read the input and output cap requi rements. The output cap is fine with the 2.5F supercap on it. But accordi ng to the data sheet the input cap needs to be as large!!! I assume I need to abide by that and find another part. Or is that about step response or some other issue that I won't need to worry with charging the supercap up to a limited voltage?

Any other parts that don't have this restriction and still have the very lo w quiescent current drain?

I'm looking at the many tricks you did with the power on FF and the alarm p ulsing circuit. To minimize the size of the supercap I'm going to pulse th e indicator when sounded. I'll need a FF because the alarm has to be silen ceable. So the power failing will trigger the alarm through a cap and pres sing the silence button will end the alarm. Not sure if the silence button will be required to be pressed periodically. If this gets too complex it becomes software in an MCU. Analog discretes have so many boundary conditi ons to explore. Software for simple tasks can be done very simply.

Open to any suggestions.

--
  Rick C. 

  -+ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

You won't get far with specialized designs if you rule out single-source parts. My approach for unusual parts, is to place an reasonable supply order before finalizing the PCB. Then as you approach full-scale production, should you be so lucky, order reels of the vulnerable parts.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Win,

I was looking at using the NCP302LSN45 in my design and I realized it has n o power pin. It would appear to scavenge power from the sense input, pin 2 . If this device has no power at all on pin 2, as it would with no USB con nection, how could it pull low on the output, pin 1?

The data sheet only assures operation when pin 2 is at some nominal level,

0.65 Vtyp and 0.80 Vmax. I don't see any other source of power feeding pin 2 other than the USB connection. Can this device be relied on to pull dow n on F1 when the USB is not connected?
--
  Rick C. 

  +- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

connected?

Hey, good catch Rick, just in time, before I order my prototype PCB. The NCP3002 has a complementary output so once its input see a supply, it pulls up. When the input is off, or very low, the low-side FET can't work, but maybe a body diode pulls down to the pin-2 voltage. I'm adding a pull-down resistor to ground to make sure.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Yes. And very cheaply as well. Placing parts from my B.O.M. into a Digi-Key cart, I was a surprised to discover that my LM4128 voltage reference, at $2.43, was more expensive than the powerful 48MHz SAMD21 Coretex M0+ controller, with 128k flash, at $2.24.

An ATTINY102-SSNR controller, in SOIC-8, costs about 50 cents, and can outperform complex analog circuits. If you consider it to be just a cheap little part... Ah, but then you have to program it.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Not sure if you are referring to the design cost of programming it or the r ecurring cost of flashing the program into the part. For simple designs th e coding would be trivial. For more complex designs like your SAM part the coding can be much more significant. I think many people over estimate th e complexity and cost of flashing a program into a part. There is always a test of the product and flashing can be incorporated into that with little cost.

I am working on a medical project currently and I don't yet know if there w ill be the typical complexities of designing medical equipment. A friend o nce worked for a company making the stuff and he had to be able to "prove" his designs worked and would never operate in a manner that would endanger health. I designing the power fail alarm which can harm someone simply by not working. How can I assure it will never fail to alarm if the power cra ps out??? I guess including two alarms complete with two sounders might do it.

Glad to help find the possible bug with the NCP3002. I kept searching your design for the pull down and couldn't find it. I ended up with the LT6700 , a dual unit. Comes in three flavors of +/- polarities. I need two compa rators and might use three if I make the design aware of it's state of char ge other than full/not full. I'm also looking at the MCP65R46 single as th e cost is a lot lower. I didn't realize the LT6700 dual is $1.68@100. The MCP65R46 single is only $0.33.

Reading about your design has helped me a lot in thinking about mine. Than ks.

--
  Rick C. 

  ++ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

Added this morning, didn't see your post earlier.

--
 Thanks, 
    - Win
Reply to
Winfield Hill

Good that this was caught. I can see where this is a detail that could be missed. It was only after I realized there was no power pin on the device that it occurred to me there might be a problem.

I'm concerned about a similar issue with my design. Presently the entire d esign is powered off the supercap. Turning on the drive to the pass transi stor to charge the supercap depends on providing a ground on a comparator O /C output as the supercap charges up from zero volts. I'm thinking of usin g a couple of Schottky diodes to wire OR the 5V rail and the supercap outpu t to power this circuit. But is it needed? Don't know... I don't think a manufacturer will spec a chip at Vdd = 0V unless the chip is designed fo r that specifically.

It just occurred to me that I can get more capacity from the supercap if I charge it to the full 5V and use a regulator to drive the indicators. An L DO with less dropout than 1V will extend the useful voltage range as the ca p discharges. If I have to wire OR the LDO output with the 5V rail it woul d be very useful if the LDO did not back feed power to the supercap.

Know of any very low dropout regulators for 10 mA that don't back feed?

Maybe the back feed is not important. Only the comparator needs power when the battery is zero voltage. I can wire OR power just for the comparators and power the indicators from an LDO. It is still important to have a low dropout voltage or it won't usefully extend the hold up time of the superc ap. How low is a reasonable LDO drop out voltage for a 4 mA load?

In fact, I guess the comparator controlling the constant current charging c ircuit is not needed if charging the supercap to full 5V so no need for pow ering anything until the supercap is up to voltage. The only concern for t he LDO is as low a dropout voltage as possible.

Thinking out loud here.

--
  Rick C. 

  --- Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

That is indeed unsatisfactory, especially taken to extremes where every net is names and there are very few wires. Relying on a PDF viewer's "search" function is, um, suboptimal.

But there is a long-established alternative, which I'm sure you must have seen and used.

For each "leaf" schematic, have all wires that goto other leaf schematics terminated in a named symbol that looks like a PCB edge connector. Then have an "interconnection" schematic containing a block for each leaf schematic. Each block has "pin" names matching those on the leaf schematic, and the pins are connected by wires.

That way you can always trace from one pin to all others merely by having your finger follow the line on the paper!

Why do you find that unacceptable?

I certainly like your explanations and constraints being right next to the relevant part of the schematic.

But your schematics don't guide the reader by drawing their eyes to the commonly used "design pattern". That's a real disadvantage, just as a non-prettyprinted computer program is a pain.

Unless you are counting pretty programs like

formatting link
or
formatting link

Reply to
Tom Gardner

Things similar to that are what I've seen "legislated" by various companies . I think designers tend to want to take short cuts and make exceptions to rules, so they need to be enforced. As Win likes, for the designer who is familiar with the design it's better to have more on a page, while not so much for everyone else if it is too cramped and requires references without connecting lines.

One company I worked for dealt with the clutter on a page by using numbers in circles with an arrow pointing to the other matching circle with the sam e number and pointing back atcha.

I find often (especially digital designs with buses) the clutter is overwhe lming and the drawing advantages are just lost entirely. At some point it might as well be some form of tabled net list to provide easy searching. T he drawing is a bunch of small lists (IC, pin number, net name) scattered a round the drawing anyway.

Someone I knew many years ago took over a design that was done that way and didn't like it. I think if it were done properly it might be better than a schematic for certain designs where the pictographs are not of much value .

Mostly the problems we perceive is the lack of adequate white space to divi de functional sections and more clearly show interconnects crossing that wh ite space. However adding the white space makes the drawing larger or make s the details smaller if shrunk down to the same total size. With many her e in the age group where visual acuity is not optimal, none of us want smal ler details.

--
  Rick C. 

  --+ Get 1,000 miles of free Supercharging 
 Click to see the full signature
Reply to
Ricky C

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.