RX230 Group, RX231 Group
Initial Settings and Usage Procedure of RTC Battery Backup Function
R01AN4831EJ0100 Rev.1.00
Page 16 of 23
Aug.20.19
4. Flowcharts
Flowcharts of the functions used by the user file described in this application note are shown below.
4.1 main Function: main()
Figure 4.1 is a flowchart of the main processing routine.
Figure 4.1 main Function
main
LCD initial settings
R_LCD_Init()
LCD display at startup
R_LCD_Display()
Time information initial settings
R_Config_RTC_Create()
Flash initial settings
R_FLASH_Open()
batty_err = 2?
Read data saved to flash
Saved to flash?
Reset time information in saved data
R_Config_RTC_Set_CalendarCounterValue ()
Display information in saved data
R_LCD_Display()
Start RTC
R_RTC_Start()
Display captured time information
display_time()
PRD interrupt initial settings
Initialize variable
Erase data flash
flash_Init()
Display RTC time information
display_time()
Display battery state and switch push count
display_info()
Check battery state
R_VBATT_GetStatus()
Check switch push count
Yes
No
Yes
No
Start voltage detection circuit
R_Config_LVD1_Start()
Initialize VBATT
R_VBATT_Open()
Is there a save history (55AAh) at
flash memory address 00100008?
Reads data (time information, battery and
switch states) from flash memory addresses
00100000 to 00100007.
Checks whether VBATT has dropped below 1.8 V while VCC was interrupted.
Is the confirmation flag (batty_err) set to 2?
Resets the data (time information, battery and
switch states) read from the flash memory.
Displays the data (time information, battery and
switch states) read from the flash memory.
Clears the switch push count variable (sw_counter).
Checks whether VBATT has dropped below 2.2 V.
Is the VBATT pin voltage monitor flag set to 1?