Tool/software: Code Composer Studio
Hi,
I'm a beginner of TI architecture so can't figure out what mistake happened at __bis_SR_register(LPM4_bits | GIE);
in any code example with
__bis_SR_register(_any LPM mode)
make code to struct at that line forever. I tried all LPM modes but nothing helpfull.
If i remove the LPM mode bits
__bis_SR_register(GIE);
this works fine. but below example won't work without LPM mode so, please someone help me to resolve this issue.
Hardware: MSP-EXP430FR2355 launchpad
Software: MSP430WARE --> msp430fr235x_tb0_22.c
// example: msp430fr235x_tb0_22.c
#include <msp430.h> int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop WDT // Configure GPIO P1DIR |= BIT0; P1OUT = 0; P2SEL0 |= BIT7; // P2.7 selected as TB0CLK // Disable the GPIO power-on default high-impedance mode to activate // previously configured port settings PM5CTL0 &= ~LOCKLPM5; // Configure Timer_B TB0CTL = TBSSEL_0 | MC_2 | TBCLR | TBIE; // ACLK, count mode, clear TBR, enable interrupt TB0R = 0xFFFF - 20; // Offset until TBR overflow __bis_SR_register(LPM4_bits | GIE); // Enter LPM4, enable interrupts __no_operation(); // For debug while (1) { P1OUT ^= BIT0; // P1.0 = toggle __bis_SR_register(LPM0_bits); // CPU is not required } } // Timer0_B3 Interrupt Vector (TBIV) handler #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) #pragma vector=TIMER0_B1_VECTOR __interrupt void TIMER0_B1_ISR(void) #elif defined(__GNUC__) void __attribute__ ((interrupt(TIMER0_B1_VECTOR))) TIMER0_B1_ISR (void) #else #error Compiler not supported! #endif { switch(__even_in_range(TB0IV,TB0IV_TBIFG)) { case TB0IV_NONE: break; // No interrupt case TB0IV_TBCCR1: break; // CCR1 not used case TB0IV_TBCCR2: TB0CCR2 += 50000; // Add Offset to TBCCR1 __bic_SR_register_on_exit(LPM0_bits);// CPU active on reti break; // CCR2 not used case TB0IV_TBIFG: // overflow TB0CTL = TBSSEL_2 | TBCLR; // SMCLK, clear TBR TB0CCTL2 = CCIE; // TBCCR1 interrupt enabled TB0CCR2 = 50000; TB0CTL |= MC_2; // Start Timer_B in continuous __bic_SR_register_on_exit(LPM4_bits);// Exit LPM4 on reti break; default: break; } }