I am developing in MSP430F6438 + CC2564 with Bluetopia SPPLEDemo.
In the SPPLEDemo project , it has Timer like the following code:
#define ACLK_FREQUENCY_HZ ((unsigned int)32768);
#define MSP430_TICK_RATE_HZ ((unsigned int)1000);
static void ConfigureTimer(void)
{
/* Ensure the timer is stopped. */
TA1CTL = 0;
/* Run the timer off of the ACLK. */
TA1CTL = TASSEL_1 | ID_0;
/* Clear everything to start with. */
TA1CTL |= TACLR;
/* Set the compare match value according to the tick rate we want. */
TA1CCR0 = ( ACLK_FREQUENCY_HZ / MSP430_TICK_RATE_HZ ) + 1;
/* Enable the interrupts. */
TA1CCTL0 = CCIE;
/* Start up clean. */
TA1CTL |= TACLR;
/* Up mode. */
TA1CTL |= TASSEL_1 | MC_1 | ID_0;
}
#pragma vector=TIMER1_A0_VECTOR
__interrupt void TIMER_INTERRUPT(void)
{
++MSP430Ticks;
/* Exit from LPM if necessary (this statement will have no effect if */
/* we are not currently in low power mode). */
LPM3_EXIT;
}
When the interrupt trigger , the MSP430Ticks will plus 1. It seems the MSP430Ticks can be use for time calculate.
But in this case , how to convert the MSP430Ticks to the Time ?
What is the time unit ? millisecond ? or microsecond ?
Thank in advance.
MSP430Ticks