Hi all
I am having trouble with servicing routines on VECTOR4 of the MSP430FR5949 ucontroller.
I am using the experimenter board MSP-EXP430FR5949 and I am trying to setup the switch on P4.5 to fire an interrupt and toggle the LED on P4.6
I use the following settings.
P4OUT = BIT5; // Pull-up resistor on P4.5
P4REN = BIT5; // Select pull-up mode for P4.5
P4DIR = BIT6; // Set all but P4.6 to input direction
P4IES = BIT5; // P4.5 Hi/Lo edge
P4IFG = 0; // Clear all P4 interrupt flags
P4IE = BIT5; // P4.5 interrupt enabled
I then have the following interrupt routing which never seems to be called when pressing the switch.
// Port 4 interrupt service routine
#pragma vector=PORT4_VECTOR
__interrupt void Port_4(void)
{
P4IFG = 0; // Clear P4 IFG
switch(P4IV)
{
case 0:
break; // No Interrupt
case 2:
break; // P4.0
case 4: // P4.1
break;
case 6: // P4.2
break;
case 8: // P4.3
break;
case 10: // P4.4
break;
case 12: // P4.5
if (ucCalON==0)
{
ucCalON = 1;
P4OUT = BIT6;
}
else
{
ucCalON = 0;
P4OUT = 0;
}
break;
case 14: // P4.6
break;
case 16: // P4.7
break;
}
}
Any ideas what's going on here people? The manual P4IV is serviced the same way as P1 and that works fine