Unused Port pins

Use this section to discuss your embedded Flowcode projects.
Post Reply
canary_wharfe
Posts: 78
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Unused Port pins

Post 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.

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: Unused Port pins

Post 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.
Martin

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: Unused Port pins

Post by canary_wharfe »

Thanks for confirming Martin

medelec35
Matrix Staff
Posts: 1432
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 506 times
Been thanked: 468 times

Re: Unused Port pins

Post by medelec35 »

You're welcome.
I have made an alteration to my original reply if you would like to reread it.
Martin

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Unused Port pins

Post 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.

canary_wharfe
Posts: 78
Joined: Thu Dec 10, 2020 3:54 pm
Has thanked: 6 times
Been thanked: 11 times

Re: Unused Port pins

Post 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).

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Unused Port pins

Post 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.

Post Reply