Hello!
I have a problem with port interrupts. I'm trying to catch remote control signals.
The problem is that the interrupt routine gets hit twice for every interrupt.
The code is below (for simplicity purposes, I configured only the port interrupt
and no other stuff like low power mode.
On top of that, the function loader_exit() is always called the first time I press
on the remote control. After that, it's never called, but the Port3ISR is still called
twice.
Any idea of what may be wrong?
Thanks,
Pascal
#include <msp.h> void ConfigIR(void); #define IR_BIT 0x04 #define LED_BIT 0x01 void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR = LED_BIT; P1OUT = 0; __disable_interrupt(); ConfigIR(); __enable_interrupt(); __sleep(); } void ConfigIR(void) { P3DIR &= ~IR_BIT; P3OUT = IR_BIT; P3REN = IR_BIT; P3SEL0 = 0; P3SEL1 = 0; P3IFG = 0; P3IE = IR_BIT; P3IES = IR_BIT; NVIC_ISER1 = 1 << ((INT_PORT3 - 16) & 31); } void Port3ISR(void) { P3IFG = 0; P1OUT ^= LED_BIT; __nop(); }