13 CLOCK TIMER (CT)
S1C17F13 TeChniCal Manual
Seiko epson Corporation
13-1
(Rev. 1.0)
Clock Timer (CT)
13
Overview
13.1
CT is a clock timer that counts a 256 Hz clock. The main features of CT are outlined below.
• Consists of an 8-bit binary counter that counts a 256 Hz clock.
• The counter data (128 Hz to 1 Hz) can be read via software.
• 32 Hz, 8 Hz, 2 Hz, and 1 Hz interrupts can be generated.
Figure 13.1.1 shows the configuration of CT.
CT
F256
Count
control
circuit
128
Hz
CTCNT[7:0]
64
Hz
32
Hz
16
Hz
8
Hz
4
Hz
2
Hz
1
Hz
Clock generator
and
Theoretical regulation
Interrupt controller
Interrupt
control
circuit
MODEN
SFTRST
8-bit counter
32 Hz interrupt
8 Hz interrupt
2 Hz interrupt
1 Hz interrupt
CT32HZIE
CT8HZIE
CT2HZIE
CT1HZIE
CT32HZIF
CT8HZIF
CT2HZIF
CT1HZIF
Inter
nal data
bu
s
1.1 CT Configuration
Figure 13.
Clock Settings
13.2
CT uses F256 (256 Hz regulated clock), which is generated by the clock generator from OSC1 as the clock source,
as its operating clock. CT is operable when OSC1 is enabled.
When using CT during SLEEP mode, the clock must be configured so that it will keep supplying by writing 0 to
the CLGOSC.OSC1SLPC bit.
Operations
13.3
Follow the sequences shown below to start counting of CT and to read the counter.
Count start
1. Write 1 to the CTCTL.SFTRST bit to reset CT.
2. Write 1 to the CT interrupt flags in the CTINTF register to clear them.
3. Write 1 to the interrupt enable bits in the CTINTE register to enable CT interrupts.
4. Write 1 to the CTCTL.MODEN bit to start CT count up operation.
Note: The timer switches to run/stop status synchronized with the count clock falling edge after data
is written to the CTCTL.MODEN bit. When 0 is written to the CTCTL.MODEN bit, the timer stops
after counting an additional “+1.” 1 is retained for the CTCTL.MODEN bit reading until the timer
actually stops. Figure 13.3.1 shows the run/stop control timing chart.