16 STOPWaTCh TiMeR (SWT)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
16-1
Stopwatch Timer (SWT)
16
SWT Module Overview
16.1
The S1C17624/604/622/602/621 includes a 1/100-second stopwatch timer module (SWT) that uses the OSC1 oscil-
lator as its clock source. This timer can be used to implement a software stopwatch function.
The features of the SWT module are listed below.
• Two 4-bit BCD counters (approximately 1/100 and 1/10-second counters)
• Approximately 100 Hz, approximately 10 Hz, and 1 Hz interrupts can be generated.
Figure 16.1.1 shows the SWT configuration.
256 Hz
Internal data bus
Interrupt request
To ITC
Feedback
divider
1/100 s 4-bit
BCD counter
1/10 s 4-bit
BCD counter
Count
control circuit
Interrupt
control circuit
Run/Stop control
Interrupt
enable
SWTRUN
SIE100
SIE10
SIE1
Reset
SWTRST
Stopwatch timer
CLG
OSC1
oscillator/divider
Approx. 100 Hz
Approx. 10 Hz
1 Hz
1.1 SWT Configuration
Figure 16.
The SWT module consists of two 4-bit BCD counters (1/100 and 1/10 second) that use the 256 Hz signal divided
from the OSC1 clock as the input clock and allows count data to be read out by software.
The SWT module can also generate interrupts using the 100 Hz (approximately 100 Hz), 10 Hz (approximately 10
Hz), and 1 Hz signals.
Operation Clock
16.2
The SWT module uses the 256 Hz clock output by the CLG module as the operation clock. The CLG module
generates this operation clock by dividing the OSC1 clock into 1/128, resulting in a frequency of 256 Hz when
the OSC1 clock frequency is 32.768 kHz. The frequency described in this chapter will vary accordingly for other
OSC1 clock frequencies. The CLG module does not include a 256 Hz clock output control bit. The 256 Hz clock is
normally supplied to the SWT module when the OSC1 oscillation is on.
For detailed information on OSC1 oscillator control, see the “Clock Generator (CLG)” chapter.
note: The OSC1 oscillator must be turned on before the SWT module can operate.
BCD Counters
16.3
The SWT module consists of 1/100-second and 1/10-second 4-bit BCD counters.
The 1/100-second and 1/10-second counter values can be read from BCD100[3:0]/SWT_BCNT register and
BCD10[3:0]/SWT_BCNT register, respectively.
Count-up Pattern
A feedback divider is used to generate 100 Hz, 10 Hz, and 1 Hz signals from the 256 Hz clock. The counter
count-up pattern varies as shown in Figure 16.3.1.