Bench Power Supply With Microcontroller

Click For Summary
When connecting a bench power supply rated at 5V@3A to a P16F88 microcontroller, a 25-ohm resistor is not necessary since the load will only draw the current it requires, which is 200 mA according to the datasheet. Excessive voltage can damage CPU chips, so it's crucial to verify that the power supply consistently outputs 5V without spikes. The microcontroller's I/O pins typically handle a maximum of 20 mA, and drawing too much current or switching inductive loads can lead to failure. Using a variable power supply can help monitor and limit current during testing. The user resolved issues with non-responsive chips by correctly configuring the MCLR pin, restoring functionality to previously "fried" chips.
PhysEd
Messages
12
Reaction score
0
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.
 
Engineering news on Phys.org
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.
 
vk6kro said:
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.

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.
 
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.
 
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 that's 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 going to 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.

EDIT:
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:
I am trying to understand how transferring electric from the powerplant to my house is more effective using high voltage. The suggested explanation that the current is equal to the power supply divided by the voltage, and hence higher voltage leads to lower current and as a result to a lower power loss on the conductives is very confusing me. I know that the current is determined by the voltage and the resistance, and not by a power capability - which defines a limit to the allowable...

Similar threads

Replies
19
Views
2K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 10 ·
Replies
10
Views
6K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
Replies
12
Views
2K
Replies
8
Views
4K