The LaunchPad with the MSP430F5529 has some push button switches. One of the switches goes to the PUR pin on the 5529. I have been unsuccessful to read from the pin. Could someone help with this?
I use this code to read from the pin and indicate it's value.
while(1) {
if(USBCNF&PUR_IN)
P4OUT |= BIT7;
else
P4OUT &= ~BIT7;
}
No matter the state of the switch, I have been getting P4.7 = 0.
I tried to unlocking the configuration regs. And I tried, but unsuccessfully, setting the PUSEL.
I used this code to unlock and set PUSEL.
USBKEYID = 0x9628; __delay_cycles(250u); USBPHYCTL_L |= PUSEL;

