APPLICATION NOTE
R01AN1713EJ0101
RX63N Group, RX631 Group
Rev. 1.01
Nov. 6, 2015
True/False Determination of RTC Time Information
on Cold Start
Abstract
This document describes the method to determine whether power is supplied from the VBATT while the voltage on the
VCC pin is dropped when using the realtime clock (RTC) and the battery backup function together. The RTC clock
settings and registers are used to determine whether the RTC continues operation or the RTC is initialized.
Products
- RX63N Group 177-pin and 176-pin packages with a ROM size between 768 KB and 2 MB
- RX63N Group 145-pin and 144-pin packages with a ROM size between 768 KB and 2 MB
- RX63N Group 100-pin package with a ROM size between 768 KB and 2 MB
- RX631 Group 177-pin and 176-pin packages with a ROM size between 256 KB and 2 MB
- RX631 Group 145-pin and 144-pin packages with a ROM size between 256 KB and 2 MB
- RX631 Group 100-pin package with a ROM size between 256 KB and 2 MB
- RX631 Group 64-pin package with a ROM size between 256 KB and 512 KB
When using this application note with other Renesas MCUs, careful evaluation is recommended after making
modifications to comply with the alternate MCU.
R01AN1713EJ0101 Rev. 1.01 Page 1 of 36
Nov. 6, 2015 RX63N Group, RX631 Group True/False Determination of RTC Time Information
on Cold Start
Contents
1. Specifications ..................................................................................................................................... 3
2. Operation Confirmation Conditions .................................................................................................... 5
3. Reference Application Notes .............................................................................................................. 5
4. Hardware ............................................................................................................................................ 6
4.1 Hardware Configuration ............................................................................................................... 6
4.2 Pins Used ..................................................................................................................................... 6
5. Software ............................................................................................................................................. 7
5.1 Operation Overview ..................................................................................................................... 7
5.2 Battery Backup Function .............................................................................................................. 8
5.3 Programming/Erasing the E2 DataFlash ..................................................................................... 9
5.3.1 Erasing the E2 DataFlash ..................................................................................................... 9
5.3.2 Programming the E2 DataFlash ........................................................................................... 9
5.3.3 Changes in the Simple Flash API ......................................................................................... 9
5.4 File Composition ........................................................................................................................ 10
5.5 Option-Setting Memory .............................................................................................................. 11
5.6 Constants ................................................................................................................................... 12
5.7 Structure/Union List ................................................................................................................... 13
5.8 Variables .................................................................................................................................... 14
5.9 Functions .................................................................................................................................... 15
5.10 Function Specifications .............................................................................................................. 16
5.11 Flowcharts .................................................................................................................................. 20
5.11.1 Main Processing ................................................................................................................ 20
5.11.2 Port Initialization ................................................................................................................ 21
5.11.3 Determination of RTC Initialization Requirement .............................................................. 22
5.11.4 Setting the Validity of the Alarm Time Information ............................................................ 24
5.11.5 Determination of the Backup Time Information for Use .................................................... 25
5.11.6 Verification of the RTC Time Information Value ................................................................ 26
5.11.7 Comparison of the RTC Time Information with the Backup Time Information .................. 27
5.11.8 Verifying the Range of the RTC Time Information ............................................................ 28
5.11.9 Reading the RTC Time Information ................................................................................... 29
5.11.10 Clock Initialization ............................................................................................................ 30
5.11.11 Sub-Clock Oscillation Setting .......................................................................................... 31
5.11.12 RTC Initialization ............................................................................................................. 32
5.11.13 RTC Periodic Interrupt Handling ..................................................................................... 33
5.11.14 Backup Processing for the RTC Time Information .......................................................... 34
6. Sample Code .................................................................................................................................... 36
7. Reference Documents ...................................................................................................................... 36
R01AN1713EJ0101 Rev. 1.01 Page 2 of 36
Nov. 6, 2015