I'm using MP430 series microcontroller. The functionality of the code is to do a specific task and then don't do anything (sense the tilt and glow an LED in a fixed amount of time). But due to some bug in the code, I'm noticing that a port pin gets '1' after some time. So now I want to disable all the ports once the task is completed. How can I disable these ports which initially I defined as Input and Output ports.
And my 2nd question is: if I'm disabling these ports then are there any chances that the output port (now disabled) will stay floating and generate some noise or something and trigger my output LED? This question is for all the microcontrollers (MSP430, PIC, AVR, etc.)