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.

CCS/MSP430FR6989: MSP430FR6989

Part Number: MSP430FR6989

Tool/software: Code Composer Studio

Hi! I'm making a Car's Computer as an Embedded Systems project and I am using lots of peripherals. Each of them works correctly when working independently, but when I put them in a single problem some of the interruptions never occur. For instance, I am using a TIVA as a slave and when the temperature reaches a specific value I send a character to the MSP430 and turn on a LED. When I try this alone, it works, but when I put them in the complete program I don't receive anything. 

The same happens when I use the ADC in the MSP430, the value of the variable attached to the registers acquires the value when working independently but if I want to modify the frequency of the Timer A register regarding to the position of the pot, neither the ADC reads the value nor the timers gets the correct value.

So, I don't know whether it is a problem with the interruptions, is there a specific configuration or should I order them in the main.c fail according to their priority levels? 

I will paste two programs, the first one that it is the principal of the Master (MSP430) and the second one that is the one with which I control the frequency of the timer.

/*
 * Computer Dash board Code Master
 *
 * This is the code for the Master microcontroller of a car's dash board computer
 * the communication protocol implemented uses UART ports in the Master as well
 * as the Slaves, but this will work like a CAN bus, because they all will have
 * communication with each other
 *
 *What is used:
 *-UART COM PORT 2
 *-UART COM PORT 4
 *-LCD 4 BITS-MODE
 *-MATRIX KEYBOARD 4X4
 *-INTERNAL TEMP SENSOR
 *-INTERNAL RTC FOR CLOCK AND CALENDAR
 *-CAPTURE MODE FOR SPEED AND DISTANCE
 *-INTERNAL PUSHBUTTON
 *
 *created 12th Nov 2017
 *by Gerardo Moreno
 */

//***********************************************************Libraries****************************************************************
#include <msp430.h>
#include <intrinsics.h>
#include <stdint.h>
#include "driverlib.h"
#include "libraries/lcd.h"
#include "libraries/itoa.h"
#include "libraries/Keypad.h"
#include "libraries/RealTime.h"
#include "libraries/stepper.h"
#include "libraries/registers.h"

//***********************************************************Constants**************************************************************
#define ONE_SECOND			8000000
#define HALF_SECOND		 	8000000 / 2
#define ONE_milliSECOND		8000

//***********************************************************Prototypes ************************************************************
void initGPIO(void);
void initClocks(void);
int verifyDisLife(void);
void initUART(void);
void initADC(void);

//***********************************************************Variables**************************************************************
uint8_t pointerLife = 11;
uint8_t pointerTripA = 11;
uint8_t pointerTripB = 11;
uint16_t counterLife = 0;
uint16_t counterTripA = 0;
uint16_t counterTripB = 0;
uint16_t lastTime = 0;
uint16_t ADCValue;
char distanceLifeChar[];
char distanceTripAChar[];
char distanceTripBChar[];
extern int optionCounter;
//*********************************************Variables in non-volatile memory*******************************************************
#pragma PERSISTENT (distanceLife)
uint32_t distanceLife = 0;
#pragma PERSISTENT (distanceTripA)
uint32_t distanceTripA = 0;
#pragma PERSISTENT (distanceTripB)
uint32_t distanceTripB = 0;
uint8_t valor;

int main(void) {

	WDTCTL = WDTPW | WDTHOLD;	//TURN OFF WATCHDOG TIMER
	PM5CTL0 &= ~LOCKLPM5;

	initGPIO();
	__delay_cycles(ONE_milliSECOND);
	initClocks();
	__delay_cycles(ONE_milliSECOND);
	//initUART();
	//__delay_cycles(ONE_milliSECOND);
	//initADC();

//	TA1CCTL2 = CM_1 | CCIS_1 | SCS | CAP | CCIE;
//	TA1CTL = TASSEL__ACLK | MC__CONTINUOUS;

	registers();					//CONFIGURE THE REGISTERS OF ALL THE PERIPHERAL USED
	reset_lcd();						//RESET LCD
	lcd_init();					//INITIALIZE LCD
	send_string("Life: 000000");
	set_cursor(0, 1);
	send_string("Trip A: 0000");
	set_cursor(13, 0);
	send_string("Km");
	set_cursor(13, 1);
	send_string("Km");


	while (1) {
//		ADC12CTL0 |= ADC12ENC | ADC12SC;

		counterLife++;

		if (counterLife == 508) {
			counterLife = 0;
			distanceLife++;
		}
		verifyDisLife();
		set_cursor(pointerLife, 0);
		itoa(distanceLife, distanceLifeChar, 10);
		send_string(distanceLifeChar);
		readKeyboard();
	}

}

//****************************************************INTERRUPT VECTORS CODE************************************************************

//ADC INTERRUPT VECTORS
#pragma vector = ADC12_VECTOR
__interrupt void ADC12_ISR(void) {
	switch (__even_in_range(ADC12IV, ADC12IV_ADC12RDYIFG)) {
	case ADC12IV_NONE:
		break;    // Vector  0:  No interrupt
	case ADC12IV_ADC12OVIFG:
		break;    // Vector  2:  ADC12MEMx Overflow
	case ADC12IV_ADC12TOVIFG:
		break;    // Vector  4:  Conversion time overflow
	case ADC12IV_ADC12HIIFG:
		break;    // Vector  6:  ADC12BHI
	case ADC12IV_ADC12LOIFG:
		break;    // Vector  8:  ADC12BLO
	case ADC12IV_ADC12INIFG:
		break;    // Vector 10:  ADC12BIN
	case ADC12IV_ADC12IFG0:             // Vector 12:  ADC12MEM0 Interrupt
		ADCValue = ADC12MEM0;
//		if (ADC12MEM0 >= 0x7ff)         // ADC12MEM0 = A1 > 0.5AVcc?
//			P1OUT |= BIT0;              // P1.0 = 1
//		else
//			P1OUT &= ~BIT0;             // P1.0 = 0

		// Exit from LPM0 and continue executing main
		__bic_SR_register_on_exit(LPM0_bits);
		break;
	case ADC12IV_ADC12IFG1:
		break;    // Vector 14:  ADC12MEM1
	case ADC12IV_ADC12IFG2:
		break;    // Vector 16:  ADC12MEM2
	case ADC12IV_ADC12IFG3:
		break;    // Vector 18:  ADC12MEM3
	case ADC12IV_ADC12IFG4:
		break;    // Vector 20:  ADC12MEM4
	case ADC12IV_ADC12IFG5:
		break;    // Vector 22:  ADC12MEM5
	case ADC12IV_ADC12IFG6:
		break;    // Vector 24:  ADC12MEM6
	case ADC12IV_ADC12IFG7:
		break;    // Vector 26:  ADC12MEM7
	case ADC12IV_ADC12IFG8:
		break;    // Vector 28:  ADC12MEM8
	case ADC12IV_ADC12IFG9:
		break;    // Vector 30:  ADC12MEM9
	case ADC12IV_ADC12IFG10:
		break;    // Vector 32:  ADC12MEM10
	case ADC12IV_ADC12IFG11:
		break;    // Vector 34:  ADC12MEM11
	case ADC12IV_ADC12IFG12:
		break;    // Vector 36:  ADC12MEM12
	case ADC12IV_ADC12IFG13:
		break;    // Vector 38:  ADC12MEM13
	case ADC12IV_ADC12IFG14:
		break;    // Vector 40:  ADC12MEM14
	case ADC12IV_ADC12IFG15:
		break;    // Vector 42:  ADC12MEM15
	case ADC12IV_ADC12IFG16:
		break;    // Vector 44:  ADC12MEM16
	case ADC12IV_ADC12IFG17:
		break;    // Vector 46:  ADC12MEM17
	case ADC12IV_ADC12IFG18:
		break;    // Vector 48:  ADC12MEM18
	case ADC12IV_ADC12IFG19:
		break;    // Vector 50:  ADC12MEM19
	case ADC12IV_ADC12IFG20:
		break;    // Vector 52:  ADC12MEM20
	case ADC12IV_ADC12IFG21:
		break;    // Vector 54:  ADC12MEM21
	case ADC12IV_ADC12IFG22:
		break;    // Vector 56:  ADC12MEM22
	case ADC12IV_ADC12IFG23:
		break;    // Vector 58:  ADC12MEM23
	case ADC12IV_ADC12IFG24:
		break;    // Vector 60:  ADC12MEM24
	case ADC12IV_ADC12IFG25:
		break;    // Vector 62:  ADC12MEM25
	case ADC12IV_ADC12IFG26:
		break;    // Vector 64:  ADC12MEM26
	case ADC12IV_ADC12IFG27:
		break;    // Vector 66:  ADC12MEM27
	case ADC12IV_ADC12IFG28:
		break;    // Vector 68:  ADC12MEM28
	case ADC12IV_ADC12IFG29:
		break;    // Vector 70:  ADC12MEM29
	case ADC12IV_ADC12IFG30:
		break;    // Vector 72:  ADC12MEM30
	case ADC12IV_ADC12IFG31:
		break;    // Vector 74:  ADC12MEM31
	case ADC12IV_ADC12RDYIFG:
		break;    // Vector 76:  ADC12RDY
	default:
		break;
	}
}

UART INTERRUPT VECTORS
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void) {
	switch (__even_in_range(UCA0IV, USCI_UART_UCTXCPTIFG)) {
	case USCI_NONE:
		break;
	case USCI_UART_UCRXIFG:
		while (!(UCA0IFG & UCTXIFG))
			;
		valor = UCA0RXBUF;
		switch (valor) {
		case 'a':
			set_cursor(0, 1);
			send_string("Motor Caliente");
			break;
		case 'b':
			P1OUT |= 0x00;
			P9OUT |= 0x80;
			break;
		case 'c':
			P1OUT |= 0x01;
			P9OUT |= 0x00;
			break;
		case 'd':
			P1OUT &= ~BIT0;
			P9OUT &= ~BIT7;
			break;

		}
		__no_operation();
		break;
	case USCI_UART_UCTXIFG:
		break;
	case USCI_UART_UCSTTIFG:
		break;
	case USCI_UART_UCTXCPTIFG:
		break;
	}
}
//TIMER INTERRUPT VECTORS
#pragma vector = TIMER1_A1_VECTOR
__interrupt void Timer1_A1_ISR(void) {
	counterLife = (TA1CCR1 - lastTime);
	lastTime = TA1CCR1;
}
//RTC INTERRUPT VECTORS
//#pragma vector=RTC_VECTOR
//__interrupt void RTC_USR(void) {
//	switch (__even_in_range(RTCIV, RTCIV_RT1PSIFG)) {
//
//	}
//}

//******************************************Functions ZONE***************************************************************************

void initGPIO(void) {
	//CONFIGURE PINS
	P1DIR |= 0x00, P1OUT = 0xFF, P1REN |= 0xFF;
	P1SEL0 |= BIT0;
	P1SEL1 |= BIT0;
	P2DIR |= 0xFF, P2OUT = 0x00;
	P3DIR |= 0xFF, P3OUT = 0x00;
	P4DIR |= 0xFF, P4OUT = 0x00;
	P5DIR |= 0xFF, P5OUT = 0x00;
	P6DIR |= 0xFF, P6OUT = 0x00;
	P7DIR |= 0xFF, P7OUT = 0x00;
	P8DIR |= 0xFF, P8OUT = 0x00;
	P9DIR |= 0x3F, P9OUT = 0x00;
	P10DIR |= 0xFF, P10OUT = 0x00;

	P1SEL0 |= BIT3;
	P1SEL1 |= BIT3;
	P2SEL0 |= BIT0 | BIT1;		//CONFIGURE P2.0/P2.1 AS UART MODE
	P2SEL1 |= BIT0 | BIT1;
	P9SEL1 |= BIT6;                           // Configure P1.1 for ADC
	P9SEL0 |= BIT6;

}

void initClocks(void) {
	//CONFIGURE CLOCKS
	CSCTL0_H = CSKEY >> 8;
	CSCTL1 = DCOFSEL_3 | DCORSEL;
	CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
	CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;
	CSCTL0_H = 0;
}

int verifyDisLife(void) {
	if ((distanceLife >= 10) && (distanceLife < 100)) {
		pointerLife = 10;
	} else if ((distanceLife >= 100) && (distanceLife < 1000)) {
		pointerLife = 9;
	} else if ((distanceLife >= 1000) && (distanceLife < 10000)) {
		pointerLife = 8;
	} else if ((distanceLife >= 10000) && (distanceLife < 100000)) {
		pointerLife = 7;
	} else if ((distanceLife >= 100000) && (distanceLife < 1000000)) {
		pointerLife = 6;
	} else {
		__no_operation();
	}
	return pointerLife;
}

void initUART(void) {
	UCA0CTLW0 = UCSWRST;                      // Put eUSCI in reset
	UCA0CTLW0 |= UCSSEL__SMCLK;
	UCA0BR0 = 52;                             // 8000000/16/9600
	UCA0BR1 = 0x00;
	UCA0MCTLW |= UCOS16 | UCBRF_1 | 0x4900;
	UCA0CTLW0 &= ~UCSWRST;                    // Initialize eUSCI
	UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt                 // Enable USCI_A0 RX interrupt
}

void initADC(void) {
	ADC12CTL0 = ADC12SHT0_2 | ADC12ON;
	ADC12CTL1 = ADC12SHP;                     // ADCCLK = MODOSC; sampling timer
	ADC12CTL2 |= ADC12RES_2;                  // 12-bit conversion results
	ADC12IER0 |= ADC12IE0;                 // Enable ADC conv complete interrupt
	ADC12MCTL0 |= ADC12INCH_14;
	while(!(REFCTL0 & REFGENRDY));
}

void modeOption(void) {
	switch (optionCounter) {
	case 0:
		set_cursor(0, 1);
		send_string("Trip A: ");
		break;
	case 1:
		set_cursor(0, 1);
		send_string("Trip B: ");
		break;
	case 2:
		set_cursor(0, 1);
		send_string("Time: ");
		break;
	case 3:
		set_cursor(0, 1);
		send_string("Temp: ");
		set_cursor(12, 1);
		send_string("°C");
		break;

	}
}

The second one:

/* --COPYRIGHT--,BSD_EX
 
//******************************************************************************
#include <msp430.h>

int showValADC;

int main(void) {
	WDTCTL = WDTPW | WDTHOLD;                 // Stop WDT

	// Configure GPIO
	P1DIR |= BIT3;
	P1OUT |= BIT3;

	P9SEL1 |= BIT6;                         // Configure P8.4 for ADC
	P9SEL0 |= BIT6;

	CSCTL0_H = CSKEY >> 8;
	CSCTL1 = DCOFSEL_3 | DCORSEL;
	CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
	CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;
	CSCTL0_H = 0;

	ADC12CTL0 = ADC12SHT0_2 | ADC12ON;      // Sampling time, S&H=16, ADC12 on
	ADC12CTL1 = ADC12SHP  | ADC12SSEL_2;                   // Use sampling timer
	ADC12CTL2 |= ADC12RES_2;                // 12-bit conversion results
	ADC12MCTL0 |= ADC12INCH_14  | ~(ADC12DIF);              // A1 ADC input select; Vref=AVCC
	ADC12IER0 |= ADC12IE0;                 // Enable ADC conv complete interrupt

	// Disable the GPIO power-on default high-impedance mode to activate
	// previously configured port settings
	PM5CTL0 &= ~LOCKLPM5;

	TA0CCTL0 = CCIE;                          // TACCR0 interrupt enabled
	TA0CCR0 = 3999;
	TA0CTL = TASSEL__SMCLK | MC__UP;          // SMCLK, UP mode

	while (1) {
		__delay_cycles(5000);
		ADC12CTL0 |= ADC12ENC | ADC12SC;    // Start sampling/conversion
		TA0CCR0 = (showValADC * 3999) / 4095;
		__bis_SR_register(LPM0_bits | GIE); // LPM0, ADC12_ISR will force exit
		__no_operation();                   // For debugger
	}

}

// Timer0_A0 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer0_A0_ISR(void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_A0_VECTOR))) Timer0_A0_ISR (void)
#else
#error Compiler not supported!
#endif
{
	P1OUT ^= BIT3;
}

#pragma vector = ADC12_VECTOR
__interrupt void ADC12_ISR(void) {
	switch (__even_in_range(ADC12IV, ADC12IV_ADC12RDYIFG)) {
	case ADC12IV_NONE:
		break;    // Vector  0:  No interrupt
	case ADC12IV_ADC12OVIFG:
		break;    // Vector  2:  ADC12MEMx Overflow
	case ADC12IV_ADC12TOVIFG:
		break;    // Vector  4:  Conversion time overflow
	case ADC12IV_ADC12HIIFG:
		break;    // Vector  6:  ADC12BHI
	case ADC12IV_ADC12LOIFG:
		break;    // Vector  8:  ADC12BLO
	case ADC12IV_ADC12INIFG:
		break;    // Vector 10:  ADC12BIN
	case ADC12IV_ADC12IFG0:             // Vector 12:  ADC12MEM0 Interrupt
		showValADC = ADC12MEM0;
//		if (ADC12MEM0 >= 0x7ff)         // ADC12MEM0 = A1 > 0.5AVcc?
//			P1OUT |= BIT0;              // P1.0 = 1
//		else
//			P1OUT &= ~BIT0;             // P1.0 = 0

		// Exit from LPM0 and continue executing main
		__bic_SR_register_on_exit(LPM0_bits);
		break;
	case ADC12IV_ADC12IFG1:
		break;    // Vector 14:  ADC12MEM1
	case ADC12IV_ADC12IFG2:
		break;    // Vector 16:  ADC12MEM2
	case ADC12IV_ADC12IFG3:
		break;    // Vector 18:  ADC12MEM3
	case ADC12IV_ADC12IFG4:
		break;    // Vector 20:  ADC12MEM4
	case ADC12IV_ADC12IFG5:
		break;    // Vector 22:  ADC12MEM5
	case ADC12IV_ADC12IFG6:
		break;    // Vector 24:  ADC12MEM6
	case ADC12IV_ADC12IFG7:
		break;    // Vector 26:  ADC12MEM7
	case ADC12IV_ADC12IFG8:
		break;    // Vector 28:  ADC12MEM8
	case ADC12IV_ADC12IFG9:
		break;    // Vector 30:  ADC12MEM9
	case ADC12IV_ADC12IFG10:
		break;    // Vector 32:  ADC12MEM10
	case ADC12IV_ADC12IFG11:
		break;    // Vector 34:  ADC12MEM11
	case ADC12IV_ADC12IFG12:
		break;    // Vector 36:  ADC12MEM12
	case ADC12IV_ADC12IFG13:
		break;    // Vector 38:  ADC12MEM13
	case ADC12IV_ADC12IFG14:
		break;    // Vector 40:  ADC12MEM14
	case ADC12IV_ADC12IFG15:
		break;    // Vector 42:  ADC12MEM15
	case ADC12IV_ADC12IFG16:
		break;    // Vector 44:  ADC12MEM16
	case ADC12IV_ADC12IFG17:
		break;    // Vector 46:  ADC12MEM17
	case ADC12IV_ADC12IFG18:
		break;    // Vector 48:  ADC12MEM18
	case ADC12IV_ADC12IFG19:
		break;    // Vector 50:  ADC12MEM19
	case ADC12IV_ADC12IFG20:
		break;    // Vector 52:  ADC12MEM20
	case ADC12IV_ADC12IFG21:
		break;    // Vector 54:  ADC12MEM21
	case ADC12IV_ADC12IFG22:
		break;    // Vector 56:  ADC12MEM22
	case ADC12IV_ADC12IFG23:
		break;    // Vector 58:  ADC12MEM23
	case ADC12IV_ADC12IFG24:
		break;    // Vector 60:  ADC12MEM24
	case ADC12IV_ADC12IFG25:
		break;    // Vector 62:  ADC12MEM25
	case ADC12IV_ADC12IFG26:
		break;    // Vector 64:  ADC12MEM26
	case ADC12IV_ADC12IFG27:
		break;    // Vector 66:  ADC12MEM27
	case ADC12IV_ADC12IFG28:
		break;    // Vector 68:  ADC12MEM28
	case ADC12IV_ADC12IFG29:
		break;    // Vector 70:  ADC12MEM29
	case ADC12IV_ADC12IFG30:
		break;    // Vector 72:  ADC12MEM30
	case ADC12IV_ADC12IFG31:
		break;    // Vector 74:  ADC12MEM31
	case ADC12IV_ADC12RDYIFG:
		break;    // Vector 76:  ADC12RDY
	default:
		break;
	}
}

  • In the first program, I don't see interrupts (GIE) being enabled at all. Also, ADCValue and counterLife should be declared "volatile". counterLife is written both in the ISR and in main(), so who knows what values you'll actually end up with.

    In the second program, showValADC should be declared "volatile". Also, read it after the LPM0, not before.
  • Can you help me with this code, I made work the ADC with the Timer, but I want to use the Capture Mode of P3.7 whose Datasheet says it uses TB0.3 and I think my code correct, but my array just shows 0's. I am trying to measure the frequency that I am generating with the Timer A and show the value on "frequency", but as I said, the arrays shows 0's. The code of the Capture Mode works fine when using ACLK as Input, but I want to use the Pin P3.7

    And one more question, I don't understand very well the CCIS register, I mean, what does it mean when it says: CCIxA, CCIxB, Vcc, Gnd

    #include <msp430.h>
    #include <math.h>
    #include <float.h>
    
    volatile unsigned int showValADC = 0;
    volatile unsigned char valueReceived;
    unsigned int verifyValue = 0;
    
    #define NUMBER_TIMER_CAPTURES       20
    
    volatile unsigned int timerAcaptureValues[NUMBER_TIMER_CAPTURES];
    unsigned int timerAcapturePointer = 0;
    float frequency = 0;
    float period = 0;
    
    int main(void) {
    	WDTCTL = WDTPW | WDTHOLD;                 // Stop WDT
    
    	// Configure GPIO
    	P1DIR |= BIT3;
    	P1OUT |= BIT3;
    
    	P3SEL1 |= BIT7;
    	P3SEL0 |= BIT7;
    
    	P9SEL1 |= BIT6;
    	P9SEL0 |= BIT6;
    
    	PM5CTL0 &= ~LOCKLPM5;
    
    	CSCTL0_H = CSKEY >> 8;
    	CSCTL1 = DCOFSEL_3 | DCORSEL;
    	CSCTL2 = SELA__LFXTCLK | SELS__DCOCLK | SELM__DCOCLK;
    	CSCTL3 = DIVA__1 | DIVS__1 | DIVM__1;
    	CSCTL0_H = 0;
    
    
    
    	ADC12CTL0 = ADC12SHT0_2 | ADC12ON;      // Sampling time, S&H=16, ADC12 on
    	ADC12CTL1 = ADC12SHP;                   // Use sampling timer
    	ADC12CTL2 |= ADC12RES_2;                // 12-bit conversion results
    	ADC12MCTL0 |= ADC12INCH_14;              // A1 ADC input select; Vref=AVCC
    	ADC12IER0 |= ADC12IE0;                 // Enable ADC conv complete interrupt
    
    	TB0CCTL3 = CM_2 | CCIS_1 | SCS | CAP | CCIE;
    	TB0CTL = TASSEL__SMCLK | MC__UP;
    
    	TA0CCTL0 = CCIE;                          // TACCR0 interrupt enabled
    	TA0CCR0 = 39999;
    	TA0CTL = TASSEL__SMCLK | MC__UP;          // SMCLK, UP mode
    
    	__bis_SR_register(GIE);
    	__no_operation();
    
    	while (1) {
    		//__delay_cycles(5000);
    		ADC12CTL0 |= ADC12ENC | ADC12SC;
    		verifyValue = showValADC;
    		if (verifyValue < 100) {
    			verifyValue = 100;
    		}
    		TA0CCR0 = verifyValue;
    		period = ((float)0.000008)*(timerAcaptureValues[6]-timerAcaptureValues[5]);
    		frequency = 1/period;
    		__bis_SR_register(LPM0_bits); // LPM0, ADC12_ISR will force exit
    	}
    
    }
    
    //
    #pragma vector = TIMER0_A0_VECTOR
    __interrupt void Timer0_A0_ISR(void) {
    	P1OUT ^= BIT3;
    	__bic_SR_register_on_exit(LPM0_bits);
    
    }
    
    #pragma vector = ADC12_VECTOR
    __interrupt void ADC12_ISR(void) {
    	switch (__even_in_range(ADC12IV, ADC12IV_ADC12RDYIFG)) {
    	case ADC12IV_NONE:
    		break;    // Vector  0:  No interrupt
    	case ADC12IV_ADC12OVIFG:
    		break;    // Vector  2:  ADC12MEMx Overflow
    	case ADC12IV_ADC12TOVIFG:
    		break;    // Vector  4:  Conversion time overflow
    	case ADC12IV_ADC12HIIFG:
    		break;    // Vector  6:  ADC12BHI
    	case ADC12IV_ADC12LOIFG:
    		break;    // Vector  8:  ADC12BLO
    	case ADC12IV_ADC12INIFG:
    		break;    // Vector 10:  ADC12BIN
    	case ADC12IV_ADC12IFG0:             // Vector 12:  ADC12MEM0 Interrupt
    		showValADC = ADC12MEM0;
    		__bic_SR_register_on_exit(LPM0_bits);
    		break;
    
    	default:
    		break;
    	}
    }
    
    #pragma vector = TIMER0_B0_VECTOR
    __interrupt void Timer0_B0_ISR(void)
    
    {
    	switch (__even_in_range(TB0IV, TB0IV_TBIFG)) {
    	case TB0IV_TB0CCR1:
    		break;
    	case TB0IV_TB0CCR2:
    		break;
    	case TB0IV_TB0CCR3:
    		timerAcaptureValues[timerAcapturePointer++] = TB0CCR3;
    		__bic_SR_register_on_exit(LPM0_bits);
    		break;
    	case TB0IV_TB0CCR4:
    			break;
    	case TB0IV_TB0CCR5:
    			break;
    	case TB0IV_TB0CCR6:
    			break;
    	case TB0IV_TB0IFG:
    		break;
    	default:
    		break;
    	}
    }
    
    
    
    

  • > P3SEL0 |= BIT7;
    Try:
    > P3SEL0 &= ~BIT7; // P3.7 -> CCI3B

    More generally: The reference of interest is data sheet (SLAS789C) Table 6-25. The P3.7 entry shows that for CCI3B (they call it TB0CCI3B here?) P3DIR.7 should be 0, P3SEL1.7 should be 1 and P3SEL0.7 should be 0. I check these tables all the time, since I can't keep so many bits in my head.

    [Edit: fixed typo in table number.]

**Attention** This is a public forum