Tool/software: Code Composer Studio
Trying to use a variable within the timerA ISR to delay the amount of time before exiting low-power mode and continue with the program, but when including the flag the length of time does not increase. To try and find the problem I modified the code and set a breakpoint in the ISR to see what the value was of the variable. When running this program, the debugger does not stop at the breakpoint even though the ISR has been triggered. Is there a reason for this, or can I change the settings of Code Composer to allow breakpoints with ISRs? The code I am running is listed below:
#include <msp430.h> void configWDT(void); void configClocks(void); void configGPIO(void); void configTimerA(void); volatile int blink_cnt; static volatile int intrp_flg; int main(void) { blink_cnt = 0; configWDT(); configClocks(); configGPIO(); configTimerA(); __bis_SR_register(GIE); // Enter LPM3 while(1) { // __bis_SR_register(GIE); // Enter LPM3 // if(blink_cnt) // { // P1OUT ^= BIT0; // } } } void configWDT(void) { WDTCTL = WDTPW + WDTHOLD; } void configClocks() { DCOCTL |= DCO1 + DCO0; BCSCTL1 |= XT2OFF + RSEL2 + RSEL1 + RSEL0; BCSCTL2 |= SELM_3 + SELS; BCSCTL3 |= XT2S_3; } void configGPIO(void) { P1DIR |= 0x03; // P1.1 output P1SEL |= 0x02; // P1.1 option select } void configTimerA(void) { //TACCTL0 |= OUTMOD_4; // TACCR0 toggle mode //TACCR0 |= 0xFFFF; TACCR0 = 0x25; TACTL |= TASSEL_1 + MC_1 + TAIE; // ACLK, up-downmode } // Timer_A3 Interrupt Vector (TAIV) handler #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=TIMERA1_VECTOR __interrupt void Timer_A(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(TIMERA1_VECTOR))) Timer_A (void) #else #error Compiler not supported! #endif { intrp_flg = 0; switch(TAIV) // Efficient switch-implementation { case 2: break; // TACCR1 not used case 4: break; // TACCR2 not used case 10: P1OUT ^= BIT0; // if(intrp_flg % 4 == 0) { // //blink_cnt++; // //P1OUT ^= BIT0; // //__bic_SR_register_on_exit(LPM3_bits); // } break; } intrp_flg++; }
The breakpoint was set at the switch(TAIV) statement and another one was set at the P1OUT ^= BIT0 statement, yet the debugger does not stop at either one.