A fully high-impedance input requires that the following configuration to be used:
Open Drain configuration (by setting appropriate values in PRTxDM0 and PRTxDM1) along with the corresponding data bit (by setting appropriate value in PRTxDR ) = 1. This disables both the NMOS and PMOS in the GPIO cell and puts it in a true Hi-Z mode.
For example, the following setting will make the pin P2 as high Z:
PRT2DM1 = 0x20;
PRT2DM0 = 0x20;
and PRT2DR = 0x20;