Timer Details: Configuring TIMER_A
Summary of Timer Setup Code – Part 1
Let’s summarize Part 1 of the timer setup code – which configures the timer’s count options. First
of all, as you can see below, we chose to place our timer setup code into its own function.
Obviously, this is not a requirement, but it’s how we wanted to organize our code examples.
Our earlier example for the Timer/Counter setup code demonstrated using the Continuous mode.
The following example shows using the Up mode. Here’s a quick comparison between the two
functions – notice that the Up mode requires two additional parameters.
TIMER_A_CLOCKSOURCE_SMCLK
TIMER_A_CLOCKSOURCE_DIVDER_xx
Used to set the CCR0 value
Enable the TAIE interrupt?
TIMER_A_TAIE_INTERRUPT_xxxxxx
Enable the CCR0 interrupt?
Clear the counter (TAR) ?
6 - 18 MSP430 Workshop - Timers