Stopwatch Timer Run/Stop Control - Epson S1C17704 Technical Manual

Cmos 16-bit single chip microcomputer
Table of Contents

Advertisement

16.5 Stopwatch Timer Run/Stop Control

Before starting the stopwatch timer, set up the conditions as shown below.
(1) Set up the interrupt level and enable the stopwatch timer interrupt if the interrupt is used. See Section 16.6.
(2) Reset the timer. See Section 16.4.
The stopwatch timer provides SWTRUN (D0/SWT_CTL register) to run and stop the counter.
∗ SWTRUN: Stopwatch Timer Run/Stop Control Bit in the Stopwatch Timer Control (SWT_CTL) Register (D0/0x5020)
The stopwatch timer starts counting when 1 is written to SWTRUN. The clock input is disabled and the timer stops
counting when 0 is written to SWTRUN.
This control does not affect the counter data (SWT_BCNT register). Even when the stopwatch timer has stopped
counting, the counter retains its count so that the timer can start counting again from that point.
When both SWTRUN and SWTRST are set to 1 at the same time, the stopwatch timer starts counting after resetting
the counter.
While the stopwatch timer is running, a cause of interrupt occurs at the falling edge of the 100 Hz (approximate 100
Hz), 10 Hz (approximate 10 Hz), and 1 Hz signals. If the interrupt has been enabled, an interrupt request is sent to
the interrupt controller (ITC).
0
BCD100[0]
1/100-second
BCD100[1]
counter
BCD100[2]
BCD data
BCD100[3]
100 Hz interrupt
10 Hz interrupt
BCD10[0]
1/10-second
BCD10[1]
counter
BCD10[2]
BCD data
BCD10[3]
1 Hz interrupt
Note: The Stopwatch timer is actually made to Run/Stop in sync with the falling edge of the 256 Hz
signal after writing to SWTRUN. Therefore, when 0 is written to the SWTRUN, the timer stops
after the counter is incremented. The SWTRUN maintains 1 for reading until the timer actually
enters Stop status.
Figure 16.5.2 shows the timer operation at start/stop.
SWT_BCNT register
S1C17704 TECHNICAL MANUAL
1
2
3
4
5
6
7
Figure 16.5.1 Timing Chart of Stopwatch Timer
256 Hz
SWTRUN(RD)
SWTRUN(WR)
27
Figure 16.5.2 Stopwatch Timer Start/Stop Operation
EPSON
8
9
0
1
2
3
4
28
29
30
31
16 STOPWATCH TIMER (SWT)
5
6
7
8
9
0
1
32
2
3
4
16-5

Advertisement

Table of Contents
loading

Table of Contents