3
\$\begingroup\$

All MCU's have digital pins, which you can configure to function as input or output.

When you set something to 'output' which is wired as an 'input', will there be any possibilities of short-circuits damaging the MCU?

\$\endgroup\$
1
  • \$\begingroup\$ Allow other people to give their point of view by waiting with accepting my (or anyone's) answer. A good rule of thumb is to wait for 24hrs so people across the globe will take a look at it. An accepted answer will get a lot less attention and therefore less peer reviews. \$\endgroup\$
    – jippie
    Commented Mar 10, 2013 at 11:33

1 Answer 1

6
\$\begingroup\$

Yes, if you configure a controller's pin as output when it has a low impedance circuit attached you may damage the controller.

For example if the circuit attached is a opamp (or a switch to either supply rail,) it is possible the current in both opamp output and controller pin exceed its maximum ratings and that may damage the output driver. Check the related datasheets for maximum ratings.

Usually a small series resistor is perfectly acceptable. For example an ATtiny can source/sink 40mA at 5V. \$R = \frac{U}{I} = \frac{5\text{V}}{40\text{mA}} = 125\Omega\$. Round that value up to the nearest E12 value and you get \$150\Omega\$ as a series resistor. Most circuits will work perfectly well with that and at the same time it protects your output drivers while experimenting. Notice that the opamp example I used may have different maximum rating. Always choose the lowest current / highest calculated resistance.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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