Bench Power Supply With Microcontroller

AI Thread 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:
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I am not an electrical engineering student, but a lowly apprentice electrician. I learn both on the job and also take classes for my apprenticeship. I recently wired my first transformer and I understand that the neutral and ground are bonded together in the transformer or in the service. What I don't understand is, if the neutral is a current carrying conductor, which is then bonded to the ground conductor, why does current only flow back to its source and not on the ground path...
Back
Top