Epson S1C63003 Technical Manual page 81

Cmos 4-bit single chip microcontroller
Table of Contents

Advertisement

10 STOPWaTCh TiMeR
Direct Run
When the direct input function is selected, RUN/STOP operation of the stopwatch timer can be controlled by
using the key connected to the input port P00/P01 (selected by SWDIR). P00/P01 works as a normal input port,
but the input signal is sent to the stopwatch control circuit. The key input signal from the P00/P01 port works as a
toggle switch. When it is input in STOP status, the stopwatch timer runs, and in RUN status, the stopwatch timer
stops. RUN/STOP status of the stopwatch timer can be checked by reading the SWRUN register. An interrupt is
generated by direct RUN input.
The sampling for key input signal is performed at the falling edge of 1,024 Hz signal same as the SWRUN control.
The chattering judgment is performed at the point where the key turns off, and a chattering less than 46.8–62.5
msec is removed. Therefore, more time is needed for an interval between RUN and STOP key inputs.
Figure 10.6.1 shows the operating timing for the direct RUN input.
f
OSC1
Direct RUN input (P00/P01)
Direct RUN internal signal
SWRUN register
Count clock
Direct RUN interrupt
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 P01/P00 (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 SWD[11:8] is read. If the LAP key is input when data has
been already held, it renews the content of the capture buffer. When SWD[11:8] is read after renewing, the capture
renewal flag is set to "1." In this case, the hold status is not released by reading SWD[11:8], 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 SWD[3:0] 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
SWD[11:8] overflow. If the capture buffer shifts into hold status (when SWD[3:0] 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 10.6.2 shows the operating timing for the direct LAP input, and Figure 10.6.3 shows the timings for data
holding and reading during a direct LAP input and reading.
f
OSC1
Direct LAP input (P01/P00)
Direct LAP internal signal
Data holding
Direct LAP interrupt
10-4
/32 (1,024 Hz)
Figure 10.
6.1 Operating timing for direct RUN input
/32 (1,024 Hz)
Figure 10.
6.2 Operating timing for direct LAP input
Seiko epson Corporation
SWD[11:8] reading
S1C63003/004/008/016 TeChniCal Manual
(Rev. 1.1)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c63004S1c63008S1c63016

Table of Contents