Hello,
I have seen contradictions and missing information on what to do with unconnected pins for the Kinetis MCUs. My application uses the Kinetis L series and I am looking for the best configuration EMC wise.
On this post Configuration for unused Pins it is said that the default or disabled configuration of the pins are the best. This contradicts AN4747 (4.7 Input and output port) where floating pins are said to be set as output low in software. I suspect things are more complex like seen in this table for the MK60FN1M0 recommended configuration for unused pins .Is there such table for the Kinetis L series?
What is the SW best practice for :
Thanks for your answer. NXP recommends to leave the pins floating, so it must be valid for most use cases. Tying external resistors would be for extra safety.
In my case the hardware doesn't need to change and is already field proof. I am just looking for the best configuration - and if you check the recommended configuration for MK60FN1M0 you can definitely see that it corresponds to default configuration/ disabled pins. For instance ADC/GPIO pins are by default set to ADC, so is setting it to a GPIO output low/high better?
I hoped that NXP could clarify this for the pin functions I listed.
I'm not sure why you're asking this question from a software perspective as it is really a hardware issue.
You want to protect the pins from ESD spikes (when somebody ungrounded is handling the board) as well as make sure you don't get unexpected voltages on the pins that leads to extra current draws.
Personally, for all the pins that can be turned into GPIOs, I configure them as digitial inputs and tie them to Vss (GND) through a 100k resistor to provide a ground path. For analog pins that can't be configured as digital inputs, I tie them to Vss through a 100k resistor. The remaining pins which can't be made into inputs or are not analog pins I generally leave floating or look to the datasheet for manufacturer specified connections.
I'll be interested in hearing other people's comments on this. I know some people who set pins to digital outputs at a set value (high or low) with no 100k ground path resistor.
An important reason for putting a 100k resistor on every pin is a practical one; when you want to or need to experiment the PCB and you need more IO pins, you have a convenient pad on the unused pin that you can solder a fly wire to. So, even if you don't plan on using the resistor, still put in part and DNP it.