Hello guys; just need verification on my assumption about this code:
This is taken from John Davies' MSP book:
TACCR0 = 49999;
TACCTL0 = CCIE;
TACTL = MC_1|ID_3|TASSEL_2|TACLR;
__enable _interrupt();
for(;;){
}
//-----------------
#pragma vector = TIMERA0_VECTOR
__interrupt void TAO_ISR(void)
{
P2OUT ^= LED1|LED2;
}
In the description it says "toggles LEDs with period of about 1s. Toggle LEDs in ISR using interrupts from timer A CCR0 in Up mode with period of about .5s."
My question is the period .5s because the default of the SMCLK is 1Mhz and since we choose SMCLK divided by 8 with the code, it's 1000000/8 = 125000. Since the counter is counting 49999 cycles it's 49999/125000 = .39s.
Is that why the comment is saying "about .5s period"?
I don't want to make any assumptions.
Thanks,