Timer Interrupt

This example demonstrates how to use the Timer in the micro-controller to generate a periodic interrupt. This is used by some of the examples to generate reliable timing. On the MSP430 this uses the MSP430's Very Low Oscillator. This example makes use of the timerIsr function pointer. This function pointer is defined in the HAL file and acts as a callback to a function in your application. To use this function pointer, first you need to declare it: extern void (*timerIsr)(void);

Next, we need to create a function that will get called when the ISR is triggered: void handleTimer {   toggleLed(0); delayMs(100); toggleLed(0); } Finally, in main we need to point the timerIsr function pointer to our handleTimer method: timerIsr = &handleTimer;



Next Example: Read EEPROM

Previous: Read IR Temperature Sensor