In this example code, the NuMicro Cortex®-M0 M031 chip is used as an example. The software Real Time Clock with timing and alarm function can be realized through the low-speed RC oscillator circuit (LIRC) inside the MCU and combined with the software algorithm. In addition, the timer works in power-down mode to reduce system power consumption and extend system life. In this application, Software Real Time Clock provides information on date (year, month, day) and time (hour, minute, second). Users can freely choose 24-hour and 12-hour output according to their needs. It can also be customized for the alarm in the interrupt handling service to meet the user's application requirements.