This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2355: Timer B interrupts

Genius 9880 points
Part Number: MSP430FR2355


Hi,

Customer need to create a timer interrupt every 1mS.

In the attached timer code the MCU never exits the ISR.

How do I clear the timer B interrupt flag?

/*
 * tick.c
 *
 */
#include "tick.h"
#include "global.h"
#include <msp430.h>

/*
 * TARGET MCU  MSP430FR2355
 * */


uint16_t tick = 0;                /* 1mS tick counter */

/*
 * @brief Initialise timer A
 * @detail
 */
void init1mSTick(void)
{
    TBCCTL0 = CCIE;                            // TBCCR0 interrupt enabled
    TBCTL = TBSSEL_2 + CNTL_0 + MC_1 + ID_2;   // 16 bit, SMCLK/4, upmode
    TBR =  10000;                               // Counter register
}
/*
 * @brief Get 1mS tick value
 *
 */
uint16_t get1mSTick(void)
{
    return tick;
}
/*
 * @brief Timer B interrupt vector
 */
#pragma vector=TIMERB0_VECTOR
__interrupt void TIMERB1_ISR(void)
{
    tick++; /* Count 1mS */
}


/*End*/

Thank you.
Regards,
May

 

**Attention** This is a public forum