16 STOPWaTCh TiMeR (SWT)
S1C17624/604/622/602/621 TeChniCal Manual
Seiko epson Corporation
16-3
BCD100[0]
BCD100[1]
BCD100[2]
BCD100[3]
100 Hz interrupt
10 Hz interrupt
1/100-second
counter
BCD data
BCD10[0]
BCD10[1]
BCD10[2]
BCD10[3]
1 Hz interrupt
1/10-second
counter
BCD data
1
2
3
4
5
6
7
8
9
0
1
2
3
4
5
6
7
8
9
0
1
2
3
4
0
5.1 SWT Timing Chart
Figure 16.
notes: • The timer switches to Run/Stop status synchronized with the 256 Hz signal falling edge after
data is written to SWTRUN. When 0 is written to SWTRUN, the timer stops after counting an
additional “+1.” 1 is retained for SWTRUN reading until the timer actually stops.
Figure 16.5.2 shows the Run/Stop control timing chart.
SWTRUN(WR)
SWT_BCNT register
27
28
29
30
31
32
SWTRUN(RD)
256 Hz
5.2 Run/Stop Control Timing Chart
Figure 16.
• Executing the
slp
instruction while the timer is running (SWTRUN = 1) will destabilize the
timer operation during restarting from SLEEP status. When switching to SLEEP status, stop
the timer (SWTRUN = 0) before executing the
slp
instruction.
SWT interrupts
16.6
The SWT module includes functions for generating the following three kinds of interrupts:
100 Hz, 10 Hz, and 1 Hz interrupts
The SWT module outputs a single interrupt signal shared by the above three interrupt causes to the interrupt control-
ler (ITC). The interrupt flag in the SWT module should be read to identify the cause of interrupt that occurred.
100 hz, 10 hz, 1 hz interrupts
The 100 Hz (approximate 100 Hz), 10 Hz (approximate 10 Hz), and 1 Hz signal falling edges set the corre-
sponding interrupt flag in the SWT module to 1. At the same time, an interrupt request is sent to the ITC if the
corresponding interrupt enable bit has been set to 1 (interrupt enabled). An interrupt is generated if the ITC and
S1C17 Core interrupt conditions are satisfied.
If the interrupt enable bit is set to 0 (interrupt disabled, default), no interrupt request will be sent to the ITC.
6.1 SWT Interrupt Flags and Interrupt Enable Bits
Table 16.
Cause of interrupt
interrupt flag
interrupt enable bit
100 Hz Interrupt
SIF100/SWT_IFLG register
SIE100/SWT_IMSK register
10 Hz Interrupt
SIF10/SWT_IFLG register
SIE10/SWT_IMSK register
1 Hz Interrupt
SIF1/SWT_IFLG register
SIE1/SWT_IMSK register
For specific information on interrupt processing, see the “Interrupt Controller (ITC)” chapter.