Page 1 of 1

Unused Port pins

Posted: Fri Jul 29, 2022 9:53 pm
by canary_wharfe
What does Flowcode do by default on device power up with the state of unused Port pins (if anything)? Are they initialised as inputs or outputs and if outputs, high or low? I know that any pins set as inputs shouldn't be left in an indeterminate floating state.

Re: Unused Port pins

Posted: Fri Jul 29, 2022 11:42 pm
by medelec35
hello.
The unused pins default to digital inputs.
If pins can be analogue, the default will be the pins changed to digital input.
If pins are digital only, then the default will be remaining as a digital input.

Re: Unused Port pins

Posted: Sat Jul 30, 2022 10:06 am
by canary_wharfe
Thanks for confirming Martin

Re: Unused Port pins

Posted: Sat Jul 30, 2022 2:33 pm
by medelec35
You're welcome.
I have made an alteration to my original reply if you would like to reread it.

Re: Unused Port pins

Posted: Mon Aug 01, 2022 12:18 pm
by BenR
canary_wharfe wrote:
Fri Jul 29, 2022 9:53 pm
I know that any pins set as inputs shouldn't be left in an indeterminate floating state.
Hello,

Leaving a floating input pin unconnected is fine as long as you're not relying on it to give a stable value in your program, for example reading a port you may have to mask off the pins you're not using. Having unused pins simply going to pads on your PCB is great way of allowing for unplanned future expansion.

Re: Unused Port pins

Posted: Thu Aug 04, 2022 10:36 am
by canary_wharfe
Ben

It was my understanding that PIC controllers should never have pins left floating as inputs regardless of whether the program masks them out as port reads because that portion of hardware will increase current consumption even though no logic state in program operation is being impacted. Perhaps that is now outdated? In the past I have set unused pins to o/p low and then leave their pads unconnected so in that situation I can edit the program later and tap into those pads (like you suggested).

Re: Unused Port pins

Posted: Mon Aug 08, 2022 11:58 am
by BenR
Hello,

You're right that the best practice is to assigning the pin as an output, or using an internal / external pull up or pull down resistor to minimise any ESD or EMI problems for a pro design.

In practise leaving pins unconnected on a modern MCU won't generally cause any problems unless your either the MCU is to be used in a very electrically noisy environment or the MCU may come into contact with static charges e.g. regular direct handling of the unconnected pins.