16 STOPWATCH TIMER (SWT)
S1C17704 TECHNICAL MANUAL
EPSON
16-5
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).
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
Figure 16.5.1 Timing Chart of Stopwatch Timer
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.
SWTRUN(WR)
SWT_BCNT register
27
28
29
30
31
32
SWTRUN(RD)
256 Hz
Figure 16.5.2 Stopwatch Timer Start/Stop Operation
Summary of Contents for S1C17704
Page 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Page 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Page 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...