Electronic – PIC Micro – Can I use both sinking and sourcing maximum current ratings if some pins sink while others source

current-sinkcurrent-sourceledmicrocontrollerpic

I intend to drive 6 LEDs with the PIC12F519 microcontroller if I am able to do so.

On page 61 of the datasheet the maximum current ratings are given:

Max current sourced per pin ……. 25 mA
Max current sunk per pin ……….. 25 mA
Max current sourced on port …… 75 mA
Max current sunk on port ………. 75 mA

Now, my question is: am I at or above the maximum ratings if half the port sources 75 mA while the other half sinks 75 mA? In other words if I source some and sink others do I have 150 mA to play with or do I have 75 mA?

Thank You

Best Answer

The maximum ratings are usually about two things, broadly speaking. One is about local dissipation -- the port pins are often arranged near each other on the die and if you dissipate too much in a small area within the micro, then that area will become a hot spot and there is a limit beyond which you shall not go. Another is about the aluminum interconnects. They design these for a certain current limit. It's likely (though I wouldn't know, specifically, here) that there are some shared current paths for the port and that these also have limits. As I understand it, either of these may have been the actual limiting factor for the absolute maximum specifications you are reading (from which you actually should stay some distance!)

If it is the ability to dissipate power away from the local area, then I would probably assume that you cannot source \$75\:\textrm{mA}\$ and also sink another \$75\:\textrm{mA}\$ on the same port. It would be about dissipation and peak local temperatures, so it would probably mean you can't do both at once. (And you generally shouldn't do it, at all, of course.) If it is about current limits for the shared parts of interconnect, and if the sinking interconnects are in no way shared with the sourcing interconnects, then the answer might be "maybe." But I still wouldn't risk it. And it is almost never about the interconnects, from a few discussions I recall having years ago. It is usually about dissipation. I've only had one case where I actually had to contact the IC designer regarding the worst case design size of their interconnects flowing from one point towards another.

EDIT: I wanted to add a note about one way to examine the absolute maximum specifications to add a little information to how you think about these pin currents.

Each pin has a small impedance to ground, when low, or to the \$V_{CC}\$ rail, when high. The P materials generally have about \$\frac{1}{3}\$rd the mobility of N materials. Mobility directly relates to impedance. So it takes more cross section area to get the same impedance from a PMOS device than an NMOS device, broadly speaking. A manufacturer will sometimes do the extra work (squander more die space) in order to balance both the high-side and the low-side MOSFETs. But usually there is a difference.

It is sometimes instructive for you to actually test this out. The experiment isn't hard to do. Just make the output drive a load resistor (or a pair of them in a Thevenin equivalent) and measure the output voltage. You should be able to work out the current and voltage, knowing your circuit and the voltage measurement, and from this you can work out the driver impedances; both to ground and to \$V_{CC}\$.

My recollection of measuring the impedance of PIC parts was that they present about \$60\:\Omega\$ sinking and about \$100\:\Omega\$ sourcing. (In any case, I don't remember the value being identical.)

Now, let's think about the absolute maximum specs of \$25\:\textrm{mA}\$ per pin and \$75\:\textrm{mA}\$ for a port.

One question arises: What about a device with four ports!! Does that mean I can go drive each port with up to \$75\:\textrm{mA}\$? No. There will also be a device maximum supply current and you should not exceed that, either.

Also, if \$75\:\textrm{mA}\$ for a port, why not \$75\:\textrm{mA}\$ for a pin on the port if the other pins aren't loaded? Well, there may be limits per pin because the metalization to the pin can't handle more and if you drive it with more you will cause the metalization to start migrating over time and that would be a bad thing. Also, all that current in one very tiny place on the die might generate temperatures that are simply too high to be tolerated, continuously. (Implanted ions also can migrate and diffuse outward away from the hot spot, spreading out the designed features and eventually destroying the functionality.) So there are absolute maximums on each pin.

Finally, in the case I mentioned with the impedances I indicated for a PIC I once measured, the heating at \$\frac{75\:\textrm{mA}}{8}=9.4\:\textrm{mA}\$ would then be about \$6−10\:\textrm{mW}\$ per pin (depending on high or low output value), if divided evenly. Say, \$50−80\:\textrm{mW}\$ total for the port. But that becomes almost \$200\:\textrm{mW}\$, if all of it were sourced out of just three pins (staying within the absolute maximums for each pin and for the port.)

I might feel that pushing \$50\:\textrm{mW}\$ for the port would be tolerable (if it bought me something in other trade-offs and didn't risk something important.) But I would definitely not feel comfortable at \$100\:\textrm{mW}\$ per port. And so, broadly speaking, I'd keep the designed pin output currents at around \$6-8\:\textrm{mA}\$ and no more than that. Even though the absolute maximum specifications suggest you can do more.