
15 ClOCK TiMeR (CT)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
15-3
5.1 CT Interrupt Flags and Interrupt Enable Bits
Table 15.
Cause of interrupt
interrupt flag
interrupt enable bit
32 Hz Interrupt
CTIF32/CT_IFLG register
CTIE32/CT_IMSK register
8 Hz Interrupt
CTIF8/CT_IFLG register
CTIE8/CT_IMSK register
2 Hz Interrupt
CTIF2/CT_IFLG register
CTIE2/CT_IMSK register
1 Hz Interrupt
CTIF1/CT_IFLG register
CTIE1/CT_IMSK register
For specific information on interrupt processing, see the “Interrupt Controller (ITC)” chapter.
notes: • The CT module interrupt flag must be reset in the interrupt handler routine after a CT interrupt
has occurred to prevent recurring interrupts.
• Reset the interrupt flag before enabling CT interrupts with the interrupt enable bit to prevent
occurrence of unwanted interrupt. The interrupt flag is reset by writing 1.
Control Register Details
15.6
6.1 List of CT Registers
Table 15.
address
Register name
Function
0x5000
CT_CTL
Clock Timer Control Register
Resets and starts/stops the timer.
0x5001
CT_CNT
Clock Timer Counter Register
Counter data
0x5002
CT_IMSK
Clock Timer Interrupt Mask Register
Enables/disables interrupt.
0x5003
CT_IFLG
Clock Timer Interrupt Flag Register
Indicates/resets interrupt occurrence status.
The CT registers are described in detail below. These are 8-bit registers.
note: When data is written to the registers, the “Reserved” bits must always be written as 0 and not 1.
Clock Timer Control Register (CT_CTl)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
Clock Timer
Control Register
(CT_CTl)
0x5000
(8 bits)
D7–5 –
reserved
–
–
–
0 when being read.
D4
CTRST
Clock timer reset
1 Reset
0 Ignored
0
W
D3–1 –
reserved
–
–
–
D0
CTRun
Clock timer run/stop control
1 Run
0 Stop
0
R/W
D[7:5]
Reserved
D4
CTRST: Clock Timer Reset Bit
Resets the clock timer.
1 (W):
Reset
0 (W):
Ignored
0 (R):
Always 0 when read (default)
Writing 1 to this bit resets the counter to 0x0. When reset in Run state, the clock timer restarts immedi-
ately after resetting. The reset data 0x0 is retained when in Stop state.
D[3:1]
Reserved
D0
CTRun: Clock Timer Run/Stop Control Bit
Controls the clock timer Run/Stop.
1 (R/W): Run
0 (R/W): Stop (default)
The clock timer starts counting when CTRUN is written as 1 and stops when written as 0. The counter
data is retained at Stop state until a reset or the next Run state.
Clock Timer Counter Register (CT_CnT)
Register name address
Bit
name
Function
Setting
init. R/W
Remarks
Clock Timer
Counter Register
(CT_CnT)
0x5001
(8 bits)
D7–0 CTCnT[7:0] Clock timer counter value
0x0 to 0xff
0x0
R