When I use below code to assign NMI pin to GPIO, it can't assign successful.
PORTB_PCR5 |= PORT_PCR_MUX(1);
But If I use below code, it can assign successful.
PORTB_PCR5 = (uint32_t)((PORTB_PCR5 & (uint32_t)~(uint32_t)
( PORT_PCR_ISF_MASK | PORT_PCR_MUX(0x06) ))
| (uint32_t)( PORT_PCR_MUX(0x01) ));
Why I must need to clear PORT PCR ISF and set it to MUX 6 first and only in this way can the assign to GPIO(MUX 1) succeed.