70
EPSON
S1C63666 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Stopwatch Timer)
Figure 4.10.5.1 shows the operating timing for the direct RUN input.
f
OSC1
/32 (1,024 Hz)
Direct RUN input (K00/K01)
Direct RUN internal signal
SWRUN register
Count clock
Direct RUN interrupt
Fig. 4.10.5.1 Operating timing for direct RUN input
Direct LAP
Control for the LAP can also be done by key input same as the direct RUN. When the direct input
function is selected, the input port K01/K00 (selected by SWDIR) becomes the LAP key input port.
Sampling for the input signal and the chattering judgment are the same as a direct RUN.
By entering the LAP key, the counter data at that point is latched into the capture buffer and is held.
The counter continues counting operation. Furthermore, an interrupt occurs by direct LAP input.
As stated above, the capture buffer data is held until SWD8–11 is read. If the LAP key is input when
data has been already held, it renews the content of the capture buffer. When SWD8–11 is read after
renewing, the capture renewal flag is set to "1". In this case, the hold status is not released by reading
SWD8–11, and it continues. Normally the LAP data should be read after the interrupt is generated.
After that, be sure to check the capture renewal flag. When the capture renewal flag is set, renewed
data is held in the capture buffer. So it is necessary to read from SWD0–3 again.
The stopwatch timer sets the 1 Hz interrupt factor flag ISW1 to "1" when requiring a carry-up to 1-sec
digit by an SWD8–11 overflow. If the capture buffer shifts into hold status (when SWD0–3 is read or
when LAP is input) while the 1 Hz interrupt factor flag ISW1 is set to "1", the lap data carry-up
request flag LCURF is set to "1" to indicate that a carry-up to 1-sec digit is required for the processing
of LAP input. In normal software processing, LAP processing may take precedence over 1-sec or
higher digits processing by a 1 Hz interrupt, therefore carry-up processing using this flag should be
used for time display in the LAP processing to prevent the 1-sec digit data decreasing by 1 second.
This flag is renewed when the capture buffer shifts into hold status.
Figure 4.10.5.2 shows the operating timing for the direct LAP input, and Figure 4.10.5.3 shows the
timings for data holding and reading during a direct LAP input and reading.
f
OSC1
/32 (1,024 Hz)
Direct LAP input (K01/K00)
Direct LAP internal signal
Data holding
Direct LAP interrupt
SWD8–11 reading
Fig. 4.10.5.2 Operating timing for direct LAP input
Direct LAP input (K01/K00)
Capture renewal flag CRNWF
SWD0–3 reading
SWD4–7 reading
SWD8–11 reading
Data holding
1 Hz interrupt factor flag ISW1
Lap data carry-up request flag LCURF
Counter data
999
000
Fig. 4.10.5.3 Timing for data holding and reading during direct LAP input