Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Timer interrupt

$
0
0

Hi everyone,

I want to use both of Timer0_A0 and Timer0_A1 interrupt. I have configured as below:

void TIM_TRIG_ADC_CFG(){
	CCTL0 &= ~CCIE;
	CCTL1 &= ~CCIE;
	TACTL = TASSEL_2 + MC_1; // Set the timer A to SMCLCK, Continuous
	TACCR0 = 50000-1;
	TACCR1 += 25000-1;
	CCTL0 |= CCIE;
	CCTL1 |= CCIE;
	// Clear the timer and enable timer interrupt
	__enable_interrupt();
}

// Timer A0 interrupt service routine
#pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A00 (void)
{
	if(!((++timerCount)%16))
	P1OUT ^= LED_RED;
}

// Timer A1 interrupt service routine
#pragma vector=TIMER0_A1_VECTOR
__interrupt void Timer_A01 (void)
{
	if(!((++timerCount1)))
	P1OUT ^= LED_GREEN;
}

It's only jump to Timer0A0 ISR, TImer0A1 is not.

Please hlep me to explain and how I can make Timer0A1 ISR working?

Thank in advance!


Viewing all articles
Browse latest Browse all 2077

Trending Articles