Any comments on my design ?!

ebeowulf17

Joined Aug 12, 2014
3,307
the unused pins of MCU configured as an outputs and 0V written to them ..
EDIT: Please ignore this post. I've seen the error of my ways now. I'm leaving the text intact as context for comments that follow, but I see now that my suggestion was a bad idea...

This might be over cautious or even just plain wrong, but I would've thought it would be better to set them as inputs.

If they're set as inputs, they're high-impedance. If anything gets connected to them that shouldn't (short circuits due to stray metal, water, whatever) essentially no current will flow. As long as they don't connect to a voltage that's outside of the abs. max ratings, no harm done.

On the other hand, if they're set low (0V) and there's an inadvertent short to the supply voltage, now you've got a high current short circuit through your mcu which could easily destroy it.

Food for thought. Please let me know if I've completely mis-analyzed these scenarios.
 
Last edited:

dendad

Joined Feb 20, 2016
4,639
Set as outputs, you drive the pins to known levels.
If you set them as inputs, they really should be pulled low or high, not left floating. That is the problem, Floating inputs can cause trouble. If you have them as inputs, make sure the internal pullups are turned on, and if the port does not have internal pullups, install external resistors for that. A SIP resistor pack can save you a lot of board space.
 

ebeowulf17

Joined Aug 12, 2014
3,307
Set as outputs, you drive the pins to known levels.
If you set them as inputs, they really should be pulled low or high, not left floating. That is the problem, Floating inputs can cause trouble. If you have them as inputs, make sure the internal pullups are turned on, and if the port does not have internal pullups, install external resistors for that. A SIP resistor pack can save you a lot of board space.
I understand why this matters on ICs like flip-flops, gates, inverters, etc. because any change in the floating input results in a changed output, and even if that output doesn't go anywhere all the high speed switching can build heat or cause instability. At least I think I understand it, mostly.

I don't understand why it would matter in an mcu where the input will be totally ignored. Is it still an issue? If so, why?
 

ebeowulf17

Joined Aug 12, 2014
3,307
Wow, nevermind. Ignore my earlier advice and questions (should I delete them?)

I just google around a bit and found several Stack Exchange discussions on the subject. Universal agreement that my suggestion is the worst thing to do, consuming extra current, adding noise, etc. I've learned my lesson.
 

dendad

Joined Feb 20, 2016
4,639
That's good that you found the reason for the non floating inputs. I'd leave your comments up as it does help others who may have similar questions. There is so much to learn and heaps of info "out there" it sometimes seems a bit to much info. But is is really a great time to be learning electronics. When I started, transistors were just very new and really hard to get, and expensive! Now you will be able to get really interesting goodies that were unimaginable back then. I wish you well on your adventure :)
 
Top