I prefer to leave unused pins unconnected (or maybe with a pad for future experimentation) and then make them outputs with a 0 value.
In reality the best solution depends on what your priorities and objectives are and what options your MCU offers you: are you looking for lowest power consumption, best EMI performance, future use of the pin, etc.
I found this post is quite thought provoking: microcontroller - Unused MCU pins, better to tie to GND or use software to prevent floating? - Electrical Engineering Stack Exchange
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.