![Seiko Epson S1C17153 Скачать руководство пользователя страница 56](http://html1.mh-extra.com/html/seiko-epson/s1c17153/s1c17153_technical-manual_1235939056.webp)
8 Real-TiMe ClOCK (RTC)
S1C17153 TeChniCal Manual
Seiko epson Corporation
8-5
(Rev. 1.0)
RTC interrupts
8.4
The RTC can generate interrupts in 10 different cycles listed in Table 8.4.1. To generate interrupts, set the inter-
rupt enable bits for the interrupt cycles to 1. If an interrupt enable bit is set to 0 (default), interrupt requests for the
cause will not be sent to the ITC.
4.1 Interrupt Cycles and Interrupt Control Bits
Table 8.
Interrupt
cycle
Interrupt timing
Interrupt flag
(RTC_IFLG register)
Interrupt enable bit
(RTC_IEN register)
One day Hour counter = 23
→
0 (24-hour mode)
Hour counter = 11pm
→
12am (12-hour mode)
INT1D
INT1DEN
Half-day
Hour counter = 11
→
12, 23
→
0 (24-hour mode)
Hour counter = 11am
→
12pm, 11pm
→
12am (12-hour mode)
INTHD
INTHDEN
1 hour
Minute counter = 59
→
0
INT1H
INT1HEN
10 minutes Minute counter = 9
→
10, 19
→
20, 29
→
30, 39
→
40, 49
→
50,
59
→
0
INT10M
INT10MEN
1 minute Second counter = 59
→
0
INT1M
INT1MEN
10 seconds Second counter = 9
→
10, 19
→
20, 29
→
30, 39
→
40, 49
→
50,
59
→
0
INT10S
INT10SEN
1 Hz
Divider 1 Hz signal cycles
INT1HZ
INT1HZEN
4 Hz
Divider 4 Hz signal cycles
INT4HZ
INT4HZEN
8 Hz
Divider 8 Hz signal cycles
INT8HZ
INT8HZEN
32 Hz
Divider 32 Hz signal cycles
INT32HZ
INT32HZEN
When the interrupt enable bit is set to 1, the corresponding interrupt flag will be set to 1 in the timing shown above
and the interrupt request will be sent to the ITC.
Since the RTC is active even in SLEEP mode, RTC interrupt requests may be used to cancel SLEEP mode.
For more information on interrupt processing, see the “Interrupt Controller (ITC)” chapter.
notes
: • To prevent interrupt recurrences, the interrupt flag must be reset in the interrupt handler rou-
tine after an RTC interrupt has occurred. The interrupt flag is reset by writing 1.
• To prevent unwanted interrupts, reset the interrupt flags before enabling interrupts with the in-
terrupt enable bits.
Control Register Details
8.5
5.1 List of RTC Registers
Table 8.
address
Register name
Function
0x56c0
RTC_CTL
RTC Control Register
Controls the RTC.
0x56c2
RTC_IEN
RTC Interrupt Enable Register
Enables/disables interrupts.
0x56c4
RTC_IFLG
RTC Interrupt Flag Register
Displays/sets interrupt occurrence status.
0x56c6
RTC_MS
RTC Minute/Second Counter Register
Minute/second counter data
0x56c8
RTC_H
RTC Hour Counter Register
Hour counter data
The following describes each RTC register.
note
: When data is written to the register, the “Reserved” bits must always be written as 0 and not 1.
RTC Control Register (RTC_CTl)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
RTC Control
Register
(RTC_CTl)
0x56c0
(16 bits)
D15–9
–
reserved
–
–
–
0 when being read.
D8
RTCST
RTC run/stop status
1 Running
0 Stop
0
R
D7–6
–
reserved
–
–
–
0 when being read.
D5
BCDMD
BCD mode select
1 BCD mode 0 Binary mode
0
R/W
D4
RTC24h
24H/12H mode select
1 12H
0 24H
0
R/W
D3–1
–
reserved
–
–
–
0 when being read.
D0
RTCRun
RTC run/stop control
1 Run
0 Stop
0
R/W
D[15:9] Reserved