So I'm just experimenting with getting an interrupt to work correctly. My code is:
#include "msp430fw427.h"
#include "intrinsics.h"
#define LED1 BIT3
#define LED2 BIT4
void main (void)
{
WDTCTL = WDTPW|WDTHOLD;
P2OUT = ~LED1;
P2DIR = LED1|LED2;
TACCR0 = 49999;
TACCTL0 = CCIE;
TACTL = MC_1|ID_3|TASSEL_2|TACLR;
__enable_interrupt();
for (;;)
{
}
}
#pragma vector = TIMER1_A0_VECTOR
__interrupt void TA0_ISR(void)
{
P2OUT ^= LED1|LED2; // set timer status flag
}
Instead of toggling the LEDs; the only thing that is happening is LED1 is staying on while the other stays off. Any ideas why they aren't toggling?
Thanks,