SLAAEN0 September 2024 MSPM0L1227 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L2227 , MSPM0L2228 , MSPM0L2228-Q1
This example shows off the Heartbeat generator still functioning when the main supply VDD experiences power loss. This example represents a real-world example such as an alarm system that was previously set when VDD was still powered and is still functioning after VDD power is lost. For this example to function correctly, power on the VBAT domain with a cell battery or an external power supply. Configure the Tamper I/O PA7 as output to drive the LED. After the setup, run the example code to toggle the corresponding LED PB2. By disconnecting the main power supply, VDD, the LED continues flashing as long as VBAT domain is powered.
#include "ti_msp_dl_config.h"
#define DELAY (16000000)
int main(void)
{
/* Initialization */
SYSCFG_DL_init();
while (1) {
delay_cycles(DELAY);
DL_GPIO_togglePins(GPIO_LEDS_USER_LED2_PORT,
GPIO_LEDS_USER_LED2_PIN |GPIO_LEDS_USER_TEST_PIN);
}
return 0;
}