My project uses only a few pins of a MSP432P401R microcontroller:
P1.2 and P1.3 for UART Mode comunication,
P1.6, P1.7 for I2C,
P2.0, P2.1, P2.2, P2.3, P2.4, P2.5 for LCD,
P3.0 for a button and
P3.1 for a buzzer.
So there are still a lot pins unused, which must be configurated according to
P. 485, 10.3.2 Configuration of Unused Port Pins, MSP432P$XX_Family_Guide.pdf:
To prevent a floating input and to reduce power consumption, unused I/O pins should be configured as I/O function, output direction, and left unconnected on the PC board. The value of the PxOUT bit is don't care, because the pin is unconnected. Alternatively, the integrated pullup or pulldown resistor can be enabled by setting the PxREN bit of the unused pin to prevent a floating input.
Obviously the job for port 1 to port 10 is easy to do, but I do not know how to do port PJ as the guidance is not clear:
NOTE: Configuring port PJ and shared JTAG pins:
The application should make sure that port PJ is configured properly to prevent a floating input. Some pins of port PJ are shared with the JTAG TDI and TDO functions, and get initialized to the JTAG functionality on reset. Other pins of Port J are initialized to highimpedance inputs by default.
Please help and thank you in advance.
Below is my configuration of unused pins of port 1 to port 10, would you please take a look and tell me if it is correct.
Also the code is based on that all the pins have internal pull up/down, is it true?
P1DIR |= BIT0+BIT1+BIT4+BIT5; //set pins p1.0,p1.1,p1.4 and p1.5 to output direction
P1REN |= BIT0+BIT1+BIT4+BIT5; //enable pullup resistor for each unused pin
P2DIR |= BIT6+BIT7;
P2REN |= BIT6+BIT7;
P3DIR |= 0xF3;
P3REN |= 0xF3;
P4DIR=0xFF;
P4REN=0xFF;
P5DIR=0xFF;
P5REN=0xFF;
P6DIR=0xFF;
P6REN=0xFF;
P7DIR=0xFF;
P7REN=0xFF;
P8DIR=0xFF;
P8REN=0xFF;
P9DIR=0xFF;
P9REN=0xFF;
P10DIR=0x1F;
P10REN=0x1F;
Thank you very much.
Merry Christmas and Happy New Year!
Sincerely
Su