![Seiko Epson S1C17153 Скачать руководство пользователя страница 100](http://html1.mh-extra.com/html/seiko-epson/s1c17153/s1c17153_technical-manual_1235939100.webp)
12 ClOCK TiMeR (CT)
12-2
Seiko epson Corporation
S1C17153 TeChniCal Manual
(Rev. 1.0)
Timer Run/STOP Control
12.4
Make the following settings before starting CT.
(1) If using interrupts, set the interrupt level and enable interrupts for the clock timer. See Section 12.5.
(2) Reset the timer. See Section 12.3.
The clock timer includes CTRUN/CT_CTL register for Run/Stop control.
The clock timer starts operating when 1 is written to CTRUN. Writing 0 to CTRUN disables clock input and stops
the operation.
This control does not affect the counter (CT_CNT register) data. The counter data is retained even when the count
is halted, allowing resumption of the count from that data.
If 1 is written to both CTRUN and CTRST simultaneously, the clock timer starts counting after resetting.
A cause of interrupt occurs during counting at the 32 Hz, 8 Hz, 2 Hz, and 1 Hz signal falling edges. If interrupts are
enabled, an interrupt request is sent to the interrupt controller (ITC).
256 Hz
128 Hz
64 Hz
32 Hz
16 Hz
8 Hz
4 Hz
2 Hz
1 Hz
32 Hz interrupt
8 Hz interrupt
2 Hz interrupt
1 Hz interrupt
OSC1A/128
CTCNT0
CTCNT1
CTCNT2
CTCNT3
CTCNT4
CTCNT5
CTCNT6
CTCNT7
4.1 Clock Timer Timing Chart
Figure 12.
notes
: • The clock timer switches to Run/Stop status synchronized with the 256 Hz signal falling edge
after data is written to CTRUN. When 0 is written to CTRUN, the timer stops after counting an
additional “+1.” 1 is retained for CTRUN reading until the timer actually stops.
Figure 12.4.2 shows the Run/Stop control timing chart.
CTRUN(WR)
CT_CNT register
0x57
0x58 0x59 0x5a 0x5b
0x5c
CTRUN(RD)
256 Hz
4.2 Run/Stop Control Timing Chart
Figure 12.
• Executing the
slp
instruction while the timer is running (CTRUN = 1) will destabilize the timer
operation during restarting from SLEEP status. When switching to SLEEP status, stop the
timer (CTRUN = 0) before executing the
slp
instruction.
CT interrupts
12.5
The CT module includes functions for generating the following four kinds of interrupts:
32 Hz, 8 Hz, 2 Hz, and 1 Hz interrupts
The CT module outputs a single interrupt signal shared by the above four interrupt causes to the interrupt controller
(ITC). The interrupt flag in the CT module should be read to identify the cause of interrupt that occurred.