Hi:
I am new to MSP430 MCU and learning it using the launchpad I just purchased. I followed a example posted by Don Bindner at http://dbindner.freeshell.org/msp430/demo.html.
Here is part of the code I have questions with:
void PreApplicationMode(void) {
P1DIR |= RED_LED + GRN_LED;
P1OUT |= RED_LED;
P1OUT &= ~GRN_LED;
BCSCTL3 |= LFXT1S_2;
BCSCTL1 |= DIVA_1;
TACCR0 = 1200;
TACTL = TASSEL_1 | MC_1;
TACCTL1 = CCIE + OUTMOD_3;
TACCR1 = 600;
__bis_SR_register(LPM3_bits + GIE);
}
The code uses two TACCRs to set the number of counts. TACCR0 = 1200 sets the counter period while TACCR1 = 600 sets the interrupt. It seems to me that the TACCR1 would trigger the interrupt every 600 clock ticks which is shorter than the number of 1200 in TACCR0. However, my observation is that the value in TACCR0 determines how often the trigger would happen while the value in TACCR1 does not as long as it is less than the value in TACCR0.
Please kindly help and thanks in advance.
--Neo