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.

MSP430FR5994: Configuring Timer B0.4 interrupt vector

Part Number: MSP430FR5994

Hello all,

I am tring to set up my MSP to measure frequency of a signal @ TB0.4 (pin 52) of the MSP430FR5994.

my code is as follows..

Inititailase timer TB0.4

Fullscreen
1
2
3
4
5
6
7
8
9
void init_TB0_4()
{
P1DIR &= ~BIT7; // Set P1.7 as an input
P1SEL0 |= BIT7; // Select Timer_B function for P1.7
P1SEL1 &= ~BIT7;
TB0CTL = TBSSEL__SMCLK | MC__CONTINOUS | TBIE | ID_1 | TBCLR; // Set Timer B0 clock source to system clock enable timer B interrupt
TB0CCTL4 = CAP | CM_1 | CCIS_1 | SCS_1; // Configure Timer B0.4 CAPture mode. Rising edge. CCIxB. Synchronous capture
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Interrupt Handler 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma vector = TIMER0_B1_VECTOR
__interrupt void Timer0_B1_ISR(void)
{
switch(__even_in_range(TB0IV,TB0IV_TB0IFG))//
{
case TB0IV_TB0CCR4:
//FCount[Fpoint++] = TA1CCR1;
if (TB0CCR4 < LastVal)
{
Overflow += 0x10000;
}
FCount[Fpoint++] = TB0CCR4 + Overflow;
LastVal = TB0CCR4;
if (Fpoint >=64)
{
TB0CCTL4 &= ~CCIE;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

i had the code working on my Dev board using Timer A1.1 (pin3) as the input and all worked fine.

Now i am running on my own board using TB0.4 it does not work, i dont even hit a break point  in the case TB0IV_TB0CCR4: when the interrut gets enabled (TB0CCTL4 |= CCIE) which is set elewhere in my code.

i'm a completly new to C and MSP coding so appologies if this a basic mistake but I cannot see wherre i have gone wrong.

Thanks,

Iain 

**Attention** This is a public forum