R01UH0823EJ0100 Rev.1.00
Page 762 of 1823
Jul 31, 2019
RX23W Group
28. Realtime Clock (RTCe)
28.
Realtime Clock (RTCe)
In this section, “PCLK” is used to refer to PCLKB.
28.1
Overview
The RTC has two types of counting modes: calendar count mode and binary count mode. They are used by switching the
register settings.
For calendar count mode, the RTC has a 100 year calendar from 2000 to 2099 and automatically adjusts dates for leap
years.
For binary count mode, the RTC does not count in terms of years, months, dates, day-of-week, hours, or minutes; it
counts seconds, and retains the information as a serial value. This mode can be used for calendars other than the
Gregorian calendar.
The RTC uses the 128-Hz clock which is acquired by the count source divided by the prescaler as the reference clock.
Year, month, date, day-of-week, a.m./p.m. (in 12-hour mode), hour, minute, second, or 32-bit binary is counted in 1/128
second units.
lists the specifications of the RTC,
shows a block diagram of the RTC, and
shows
the pin configuration of the RTC.
Note 1. Satisfy the frequency of the peripheral module clock (PCLKB) ≥ the frequency of the count source.
Table 28.1
RTC Specifications
Item
Description
Count mode
Calendar count mode/binary count mode
Sub-clock (XCIN)
Clock and calendar
functions
Calendar count mode
Year, month, date, day-of-week, hour, minute, second are counted, BCD display
12 hours/24 hours mode switching function
30 seconds adjustment function (a number less than 30 is rounded down to 00 seconds, and 30 seconds or
more are rounded up to one minute)
Automatic adjustment function for leap years
Binary count mode
Count seconds in 32 bits, binary display
Common to both modes
Start/stop function
The sub-second digit is displayed in binary units (1 Hz, 2 Hz, 4 Hz, 8 Hz, 16 Hz, 32 Hz, or 64 Hz).
Clock error correction function
Clock (1 Hz/64 Hz) output
Interrupts
Alarm interrupt (ALM)
As an alarm interrupt condition, selectable which of the below is compared with:
- Calendar count mode: Year, month, date, day-of-week, hour, minute, or second can be selected
- Binary count mode: Each bit of the 32-bit binary counter
Periodic interrupt (PRD)
2 seconds, 1 second, 1/2 second, 1/4 second, 1/8 second, 1/16 second, 1/32 second, 1/64 second, 1/128
second, or 1/256 second can be selected as an interrupt period.
Carry interrupt (CUP)
An interrupt is generated at either of the following timings:
- When a carry from the 64-Hz counter to the second counter is generated.
- When the 64-Hz counter is changed and the R64CNT register is read at the same time.
Recovery from software standby mode can be performed by an alarm interrupt or periodic interrupt
Time capture function
Times can be captured when the edge of the time capture event input pin is detected.
For every event input, month, date, hour, minute, and second are captured or 32-bit binary counter value is
captured.
Event link function
Periodic event output