10
\$\begingroup\$

I am working on an MSP430 project that requires me to route the output of one peripheral into the input of another peripheral. Thus, I have two MCU pins connected directly to each other. This looks suspicious to me since there is the possibility of a programming error causing both to be (possibly conflicting) outputs. Also, there is the issue of startup and programming states.

In the worst case, if one pin is driving HI, the other is driving LO, the GPIO pins generally have way more sink capability than source capability... so it'll be somewhat like taking a HI output and shorting it to near-ground. Which is bad... but how bad is it? Is it likely to cause damage to the MCU?

I often see examples on the web of people using Arduinos to light an LED between two pins without a resistor, and I haven't heard of any stories of anyone frying anything but the LED. Clearly you wouldn't want to do this in a product, but do manufacturers generally try to protect the MCU from GPIO pins being overloaded anyway?

Thinking about it in retrospect, putting a current-limiting resistor between the two pins would have prevented any worries, but even a minor hardware change is a very difficult thing to do at this point.

For future reference and the benefit of posterity, does anyone have any other ideas about the proper way of minimizing the risks of connecting two MCU pins together, and more generally, minimizing the risks that come from the possibility of overloading a GPIO pin?

\$\endgroup\$
  • \$\begingroup\$ I too use msp430 controllers if you use both the pins as output there is the possibility of shorting.but if you configure a pin as output and another as input it wont create a trouble.but anyway what is the peripheral you want to connect with? \$\endgroup\$ – yogece Oct 23 '13 at 20:04
  • \$\begingroup\$ I'm connecting a timer output to a different timer's input. The question is entirely about the possibility of shorting. I am not thinking about using them both as outputs, but there is always the chance of them both (at least momentarily) being outputs accidentally, due to factors outside of my control. \$\endgroup\$ – Dmitri Oct 23 '13 at 20:14
6
\$\begingroup\$

It's not a problem but if you are worried that there maybe a conflict of outputs then connect them with a 1k ohm resistor. This will limit the current accordingly.

If however, the input needs really fast edges then when you are sure it is working, bridge the 1k ohm with a short or 100 ohms maybe.

The added bonus of having the resistor is that if you have the design commited to PCB then it gives you an easy re-wire option.

It's the same problem with unused inputs - tie them to ground or Vcc and you risk heavy current draw from the device without any easy way to work out what is going on - tie via a 1k if unused or maybe 10k.

Overload limiting is done on some chips but only by virtue that the transistors cannot inherently supply "amps" but this can work against you because if you have several o/p pins shorted to ground (or each other) and each one is limiting gracefully, you may still exceed the max rating of current into the power pins of the device.

For the MSP430 series 2 page 21 of this document says: -

enter image description here

This tells me that if the combined output currents of several pins hits a certain limit then the output capabilities of any other pins (even those that may be lightly loaded) may be impaired by the same amount or possibly worse.

\$\endgroup\$
  • \$\begingroup\$ I did look at electronics.stackexchange.com/questions/50539/… and the others in that group of at least three duplicates. You make a very good point about overcurrenting the PSU pin - I think that's probably the biggest danger of connecting unused pins to GND/PSU. So.. the transistor on the GPIO pin probably just won't conduct nearly enough to damage itself (unless shorted to something way out of PSU range). \$\endgroup\$ – Dmitri Oct 23 '13 at 20:47
  • \$\begingroup\$ Why would unused inputs (Considered High-Z) lead to heavy current draw? \$\endgroup\$ – Passerby Oct 23 '13 at 20:49
  • \$\begingroup\$ @passerby If you connect them to a PSU rail as some people like to do and they accidentally become outputs. See the questions in the string I linked to, pretty interesting discussion. \$\endgroup\$ – Dmitri Oct 23 '13 at 20:53
  • \$\begingroup\$ @passerby the OP was suggesting this "the possibility of a programming error causing both to be (possibly conflicting) outputs" and I'm assuming this applies to programming errors on unused pins. \$\endgroup\$ – Andy aka Oct 23 '13 at 20:54
  • \$\begingroup\$ It's just that the line as is makes it seem as if unused inputs tied to a rail without any type of programming error cause heavy draw. \$\endgroup\$ – Passerby Oct 23 '13 at 21:10
2
\$\begingroup\$

The biggest problem is as you have mentioned, programming errors. There is a potential for issues, so you have to code carefully. Other than that, as long as the pins are not both outputs with different levels, it is fine.

Using two pins to drive a single source is not uncommon (combining current output).

Using two pins to drive an led (or two) is also not uncommon. While not using a resistor is not recommended, you can get away with it. If your output voltage is relatively close to the led forward voltage, then current draw may not be an issue. And there is the pin voltage droop. As current sourced Increases, Voltage at that pin Decreases (Vcc to Vcc - 0.3 to -1, etc). As current sinked Increases, the Voltage Increases (From Gnd to Gnd + 0.3v to + 1v, etc). It is a bit of a self correcting blessing, but shouldn't be relied upon.

And as you have already said, a simple current limiting resistor could be used.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.