Unused Port pins
-
- 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
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.
-
- Matrix Staff
- Posts: 1560
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 555 times
- Been thanked: 514 times
Re: Unused Port pins
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.
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
-
- Posts: 78
- Joined: Thu Dec 10, 2020 3:54 pm
- Has thanked: 6 times
- Been thanked: 11 times
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Unused Port pins
Hello,canary_wharfe wrote: ↑Fri Jul 29, 2022 9:53 pmI know that any pins set as inputs shouldn't be left in an indeterminate floating state.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
-
- Posts: 78
- Joined: Thu Dec 10, 2020 3:54 pm
- Has thanked: 6 times
- Been thanked: 11 times
Re: Unused Port pins
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).
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).
-
- Matrix Staff
- Posts: 1882
- Joined: Mon Dec 07, 2020 10:06 am
- Has thanked: 484 times
- Been thanked: 661 times
Re: Unused Port pins
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel
Flowcode Online Code Viewer (Beta) - Flowcode Product Page - Flowcode Help Wiki - My YouTube Channel