This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2355: Trying to read PxIN registers in IF statement???

Part Number: MSP430FR2355


I have a bunch of switches connected to the MSP.  I capture the interrupt flag of which switch is thrown into a variable and then debounce for 200ms.  This all works great.  I then want to see if that switch is held for 2 seconds so I enable a second CCR on the timer and jump into it every 100ms.  In theory if I jump into this 20 times I will have 2 seconds that the switch was held.  The issue I am running into is I am using the original switch ISR flag which triggered the event and am reading it against the PxIN register but the PxIN register seems to give me bad data.

For instance if I place a break point in the CCR ISR and stop the debugger.  I look at P1IN and see 0x3A.  This is correct but if I place the expression (char*)PIIN into the EXPRESSIONS window I get 0x3E....

Can someone explain?  These switches all have internal pullups so 3E is the default state.  3A indicates that 1.2 got pulled low which it did .

Thanks

**Attention** This is a public forum