SLAAEN0 September 2024 MSPM0L1227 , MSPM0L1227-Q1 , MSPM0L1228 , MSPM0L1228-Q1 , MSPM0L2227 , MSPM0L2227-Q1 , MSPM0L2228 , MSPM0L2228-Q1
This example uses CCS Tamper I/O heartbeat code example to demonstrate the use of a supercapacitor charging circuit. To begin with the example, change the VBAT jumper from VDD to CAP. Then in the software, enable the supercapacitor register for the supercapacitor charging circuit to function. Configure the desired Tamper I/O as an output and connect the Tamper IO to PB2 LED to perform the heartbeat generator. After the supercapacitor is fully charged up, disconnect the main power supply VDD. The supercapacitor starts charging back the VBAT domain. As the VBAT domain is powered up, the LED continues flashing after the main power supply loss to show that the supercapacitor charging circuit is working properly. The LED eventually stops flashing as the supercapacitor is completely discharged.
#include "ti_msp_dl_config.h"
#define DELAY (16000000)
int main(void)
{
/* Initialization */
SYSCFG_DL_init();
DL_SYSCTL_enableSuperCapacitor(); /*enables SuperCap register to perform supercap charging circuit example */
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;
}