140
* TA0CTL, Timer_A3 Control Register
*
* TASSEL_2 -- SMCLK
* ID_3 -- Divider - /8
* MC_1 -- Up Mode
*/
TA0CTL = TASSEL_2 | ID_3 | MC_1;
/* USER CODE START (section: Timer0_A3_graceInit_epilogue) */
/* User code */
/* USER CODE END (section: Timer0_A3_graceInit_epilogue) */
}
Inside the interrupt function, the LEDs of Launchpad board are toggled. Note that after the occurrence
of the interrupt LPM0 is exited.
#pragma vector = TIMER0_A0_VECTOR
__interrupt void TIMER0_A0_ISR_HOOK(void)
{
P1OUT ^= (BIT0 | BIT6);
__bic_SR_register_on_exit(LPM0_bits);
}
In the main, there is no task and in it LPM0 is entered. Thus, the process is independent of the main
and is energy efficient.
while(1)
{
__bis_SR_register(LPM0_bits);
};
Demo
Demo video: https://youtu.be/Q7z8qEF04UY.