Switch to tie IC input h/l

Discussion in 'General Electronics Chat' started by Cammack, Feb 19, 2013.

  1. Cammack

    Thread Starter New Member

    Feb 19, 2013
    9
    0
    Hello, first post, so I'll briefly introduce myself! I've played around building circuits designed by others for a long time, but have never before dipped my toes into the 'design' pool before.

    I'm putting together a circuit that at the heart of it uses an IC to control load sharing and manage battery charging (MCP73871).

    One of the IC pins, 'SEL', may be tied high or low.
    High - up to 1.8A may be drawn from the supply (if, say, a wall-wart is providing power)
    Low - up to 0.5A may be drawn (if a USB is providing power)

    Power is connected to the circuit via a USB connector. A USB wall-wart will let a device know that it can draw up to 1.8A by tying together the D+ and D- pins.
    So there's my switch, all I need to do is connect +V to one of the USB data pins, and the other to the 'SEL' pin, and when plugged into a USB wall-wart charger, the circuit knows it can pull 1.8A...

    The problems -
    1) When plugging into a normal USB port, I've immediately put the potential from the power pins right across the data pins. Does this matter? Can I simply protect with a resistor (the port output impedance should be circa 90Ω)? Do I need to isolate somehow?

    2) When plugged into a normal USB port the 'SEL' pin is left floating, not tied to ground. I can maybe see a way round that with two NPN transistors to invert, and then invert back, as per the attached... but I'm sure I've over-simplified this. Any comments? Can you advise a better solution? Would this even work at all?

    Thanks in advance,
    Cam
     
    • sel.png
      sel.png
      File size:
      8.4 KB
      Views:
      29
  2. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,363
    You can eliminate the transistors and do it with one resistor.
    33kΩ should be good enough to either pull up or pull down SEL which ever way you want it.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    The SEL input is very high impedance so you don't need the transistors. If I followed this correctly, low current is a low (provided by the 100K I added) and a high is provided when the wart shorts D+ to D- and gives SEL a high (about 2.5V).

    High value resistors should keep the master side safe.

    Note I've bypassed your transistors and switch <grin>

    [​IMG]
    Do check this out as I am not sure about the master side of USB, but I believe this will *not* look like a device to say a PC and thus not try to connect.
     
  4. Cammack

    Thread Starter New Member

    Feb 19, 2013
    9
    0
    Thanks for the replies, you both have me kicking myself! :rolleyes:

    2.5v is indeed plenty above the 1.8 required by the IC for a high signal.

    With a pair of 100ks (if my sums are correct) the remaining potential across the data pins would be only 2.25mV, and the available current would only be 1/40th of a milliamp. I can't imagine this could do any worse than confuse the device being plugged into...

    Quick question ErnieM - How did you find the input impedance at SEL? I looked for a figure, but couldn't find it in the datasheets.

    (My diagram showed a switch, but I was just using that to represent a wallwart shorting the D+ & D- pins.)
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,447
    3,363
    Page 7
    Input Leakage Current = 0.01μA typical, 1μA max
    i.e. > 1MΩ
     
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    I found it the old fashioned way: I hit CRTL-F (for FIND), entered SEL, and hit F3 until I got to the same input spec MrChips found on page 7.

    If I was actually using the device I would have read it all (OK, skimmed some parts) but to answer your Q all I was intetested in was what that pin looked like electrically. Also, by searching that way I stopped on the internal schematic and peeked some there.
     
  7. Cammack

    Thread Starter New Member

    Feb 19, 2013
    9
    0
    Ah, I was specifically searching for an impedance figure, I see now that it's implied by the very low leakage current.

    Always learning, thank you both very much for your help!
     
  8. Cammack

    Thread Starter New Member

    Feb 19, 2013
    9
    0
    Hello again,

    The resistive divider for the SEL pin described in the previous posts works exactly as intended. With the USB-in data pins tied (as in a USB wall-wart charger), the chip provides 'fast charge current' to the load. Otherwise (say, plugged into a PC USB port), it restricts the charge current to 500mA.

    Thanks to MrChips and ErnieM for the help!
    (also thanks to Adafruit for the basic designs of the two circuits I put together -
    Adafruit USB, DC & Solar Lipoly Charger
    MintyBoost V3)

    I'm very happy with how the circuit turned out as it's my first attempt at SMD soldering, it's a QFN chip, and only the third PCB I've etched myself. So all in all, I'm quite surprised I got it working at all, especially after the scorching I gave the poor QFN! If anyone would like the Eagle schematic and board just let me know.

    ---

    Sorry if this should be a separate thread, but I have another question related to the same chip as above -

    I stated in the OP that the MCP73871 could draw up to 1.8A from a wall-wart, which according to the first page of the datasheet is correct... but looking further, I think this maximum of 1.8A drawn is during 'load sharing' - providing a portion of the supply to recharging the batteries, and a portion to the output load.

    5.1.2, P23, explains that the 'fast charge current' is set by resistor Rprog1. A 1kΩ resistor = 1A, a 10kΩ resistor = 100mA

    ...So a 560Ω for Rprog1 would work out to 1.78A...

    1.0, P7, DC characteristics, Prog1 input (Rprog1) gives a min/max range of 1kΩ/20kΩ.

    I think this is telling me that to use a resistor lower than 1kΩ is passing too high a current through the chip, and that a minimum of 1kΩ and maximum charge current of 1A is the (recommended) upper limit.

    What I'm hoping for is that someone can confirm or refute that - am I reading the datasheet right?

    I currently have 560Ω in for Rprog1, and it works, but the chip gets hot. Too hot to touch for even a second. But 4.10, P21, says that there's a built-in thermal shutdown if the chip die gets up to 150°C, so is this anything to worry about?


    Thank you,
    Cam
     
  9. Cammack

    Thread Starter New Member

    Feb 19, 2013
    9
    0
    Turns out the manufacturer has a design guide application note which lays it all out quite clearly -

    MCP73871 application note

    I wish I'd found this BEFORE I'd finished making the circuit!

    Right enough, a minimum resistance of 1kΩ is advised for a maximum charge current of 1A.

    Cam
     
Loading...