Other Parts Discussed in Thread: CCSTUDIO, MSP430G2231
Hi guys,
I've gone through the Lab 5 of the TI workshop tutorial for MSP430 about timer and interrupts. I've found out that many tutorial topics just tell us what to do without telling us why.
I have a few things don't understand:
#pragma vector = TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON;
_delay_cycles(5); // Wait for ADC Ref to settle
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
P1OUT |= BIT6; // P1.6 on (green LED)
_delay_cycles(100);
ADC10CTL0 &= ~ENC; // Disable ADC conversion
ADC10CTL0 &= ~(REFON + ADC10ON); // Ref and ADC10 off
tempRaw = ADC10MEM; // Read conversion value
P1OUT &= ~BIT6; // green LED off
CCR0 +=12000;
}
Above is a ISR for a timer in the tutorial.
May I ask what is #pragma vector = TIMERA0_VECTOR? Is it that we always need to declare it for before our ISR?
The name TIMERA0_VECTOR is it fixed? Or we can change to other name like FIRSTTIMER_VECTOR?