MCU current out?

Discussion in 'General Electronics Chat' started by #12, Mar 3, 2013.

  1. #12

    Thread Starter Expert

    Nov 30, 2010
    16,313
    6,817
    I was working on some universal output drivers for MCU's and I wish to know, what is the worst case (lowest) current capability I can expect from a micro controller chip?

    Which family? All of them.

    And, can MCU's sink current? And how much, worst case?

    For a 3.3V chip?
    For a 5V chip?
    Did I miss any?
    I expect they can't output right to the rail under load. How about a criteria of "failure to output the full rail voltage by, say, 1/2 volt"?
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,015
    This will be found in the datasheet. You need to first pick a chip. For the microchip mcus I have used around 20 ma @ 5v.
     
  3. #12

    Thread Starter Expert

    Nov 30, 2010
    16,313
    6,817
    We get questions at AAC every week about, "How can I connect an MCU to a relay" or some other similar thing. I'm trying to make a group of UNIVERSAL output drivers for MCUs that I can present to the noobies. I can't look up every datasheet for every MCU in the world.

    How about this: Can I reasonably bet that any MCU will output 1 milliamp?
    Do MCU's also sink current?
    Are they good at outputting the rail voltage or do they always miss by a little bit?
     
  4. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    4mA is OK for most.

    There are tiny 3.3V relays I have some here for reference.

    Some controllers with high-current outputs can drive them.

    Yes voltage can go off considerable when you load with 50mA.
    So the LEDs get less current. There is a point where it stabilizes.

    Atmel controllers should not be shortened they give 70mA and more.

    They also may need small resistors at 5V for LEDs.
    I measured with a micro Arduino- 60mA for a single LED.
     
    #12 likes this.
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    The PIC 18f45k20 I/O's I am using source 3mA at VCC-.7V. They sinc no appreciable current - uA range. I'm interfacing the I/O's via SN7407n I had on hand. It requires only 40uA input current ( good for any uC ever made, I'm sure ) and can sinc 40mA and are up to 30V output voltage tolerant. Those specs should be good enough for a wide variety of applications, relays, LED's, etc. More current requirements can be met by connecting the output of the 7407 to a power FET.
     
    #12 likes this.
  6. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    Untrue. They are specfied to sink up to 8.5 mA with a 0.6V output voltage rise. (See Table 26.9 DC Characteristics: Input/Output Characteristics, PIC18F2XK20/4XK20, parameter D080.)

    Thus they will sink over twice the current they source (which sounds appreciable to me).


    #12: If I was attempting to design some "universal" buffer I would make it so the input current was extremely minimal or "zero" to a first approximation.
     
    #12 likes this.
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Yes, good catch. I was in a hurry and must have been looking at input current when the pin was turned around to input.
     
  8. I Smell Smoke

    New Member

    Mar 3, 2013
    3
    0
    Is it worthwhile to suggest some sort of signal isolation between the MCU and the uP? Or are the MCU inputs already isolated from any spikes and nasties you catch from motors? Just a thought.
     
  9. Papabravo

    Expert

    Feb 24, 2006
    10,148
    1,791
    There is no such thing as a universal output driver and your attempt is doomed. Anybody that would use such a circuit without consulting the datasheeet will get as much as they deserve. What do you take us for anyway? Sheesh!

    Teach the noobs to fish and they can design their own output drivers.
     
  10. #12

    Thread Starter Expert

    Nov 30, 2010
    16,313
    6,817
    I see we have a candidate for the place Audioguru used to hold.
    What can I say? Be careful not to use any of these circuits because they can't be used to provide more current when driven by the output of a microcontroller? Be careful not to show these to beginners and hobbyists because they should figure them out by themselves?
     
    Last edited: Mar 4, 2013
  11. GetDeviceInfo

    Senior Member

    Jun 7, 2009
    1,571
    230
    as a general rule, you'll find sinking capacities substantially higher than those sourced. My guess would be the most universal driver would then have variable, or select-able voltage sourced inputs, which could be sunk by the mcu.
     
    #12 likes this.
  12. russ_hensel

    Well-Known Member

    Jan 11, 2009
    818
    47
    A universal driver, in my opinion, is not a good idea: it will be over engineered for most uses and more expensive and complicated than it should be. Why not do a small family of drivers for some common tasks that are compatible with some common mcu's?
     
    #12 likes this.
  13. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    LCX244 could be used. It is even possible to parallel outputs, if you parallel the same inputs.

    This is an octal buffer, 2x 4bit

    HC543 or F543 is a bi-directional buffer with latch and output enable.
     
    #12 likes this.
  14. #12

    Thread Starter Expert

    Nov 30, 2010
    16,313
    6,817
    That's exactly what I'm doing. See circuits in post #10.
     
  15. #12

    Thread Starter Expert

    Nov 30, 2010
    16,313
    6,817
    I actually don't know the difference between an MCU and a uP, or why you would have both of them on the same circuit board. What I do know is that a lot of people want their Arduino, or a PIC, or some other small processor to provide more current than an LED needs. There are (at least) a dozen ways to do this when you consider bipolar, mosfet, inverting, not inverting, open collector, open emitter, etc. Now you have brought up the idea of using an opto-isolator, which I think is an absolute must when driving a 120V or 240V line powered load.

    Consider AN-31, the op-amp circuit collection. It goes on for pages and still doesn't have all the possible circuits. As Papabravo said, it's a guaranteed fail, but thousands of people have used it successfully.
     
Loading...