Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Bench Power Supply With Microcontroller

  1. Jul 23, 2011 #1
    I know this question is so simple and probably stupid that it will enrage some people, but bear with me. :)

    When connecting a bench power supply that does 5V@3A, to let's say a P16F88, should I use 25 ohm resistor to bring those 3 Amps down to 200 ma?

    According to the p16f88 datasheet:

    Maximum current into VDD pin: 200 mA

    And by doing so, can I expect 200mA to come out of an output Pin when I turn it on in the pic?

    And finally, the reason I ask is that I didnt use a resistor, and I connected the power supply directly to the PIC and after programming it maybe once or twice it no longer works (as in does not return proper ID when programmer asks for it).

    I am assuming I fried it and am looking for a solution, thanks.
  2. jcsd
  3. Jul 24, 2011 #2


    User Avatar
    Science Advisor

    The current shown as 3 amps is just a maximum rating. If the voltage is 5 volts, the load will draw whatever current it was designed for.

    In this case, it takes 200 mA from the supply even though this is only a fraction of what the power supply is designed for.

    CPU chips are very intolerant of excessive voltage, though, so it would be worth checking the exact power supply voltage before installing a new chip. if it is more tha 5 volts, even by half a volt or more, you should not use this supply.

    200 mA seems like a lot of current for a CPU chip and the chip would probably only draw this much current if you were trying to drive a low resistance load from one or more of the outputs or if you had an output that was shorted to the negative supply rail.
  4. Jul 24, 2011 #3
    Yeah, what you say makes sense and I figured this is how it should be.

    But somehow I have fried like 6 chips in the span of a few months and all though I haven't made any ruling out, it feels like it always happens when I use my Bench power supply instead of a 9V battery and a 7805.

    Allthough the power supply says it's a dedicated 5V, maybe it somehow jumps sometimes and fries the chips.

    Hmm, I'll keep buying chips and see if I can narrow it down.
  5. Jul 24, 2011 #4


    User Avatar
    Science Advisor

    200 mA is the max current for the entire chip, but most Microchip I/O pins source or sink a max of 20 mA (there's a constraint for total amount in/out of a port, also).

    If your I/O lines are sourcing too much current, or switching highly inductive loads (e.g. relays or motors), you may be toasting the micro that way as well. If you are, I suggest either using a BJT or FET switch, or some flyback diodes.

    EDIT: Additionally, if you have a nice bench supply, I'd suggest avoiding the 5V fixed output, and using the variable voltage / variable current ones. This way, you can limit the current going into your circuit (set the output to 5V, and then slowly ramp the current up until the current limiting turns off). If your micro alone is drawing 100 mA at 5V, you probably have a problem.
  6. Jul 24, 2011 #5
    I like the idea of using the variable output on the power supply to see the current being used.
    I just assumed that dedicated 5V output was created for this sort of thing and thats what I have been using.

    Also, I think I might have discovered my problem with the chips stopping working.

    I set the MCLR pin to be used as I/O and I assumed this turned OFF anything special the MCLR pin does. But as it turns out, when I set the MCLR to i/o, it internally ties to ground or 5V or whatever and if I use the internal oscillator at the same time, this can cause the chip to stop responding to ID requests from the programmer.

    I'm gonna try to set the MCLR pin through a resistor to 5V and see if I can salvage my old chips or at least prevent any new chips from going insane.

    Hah! I tied the MCLR to +5V and set MCLR_ON as a config bit, and all my "dead" chips are working again!
    Thanks for helping my brain get on the right track :D
    Last edited: Jul 24, 2011
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook