54
EPSON
S1C60N13 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Stopwatch Timer)
SWIT0, SWIT1: Interrupt factor flags (2EAHD0 and D1)
These flags indicate the status of the stopwatch timer interrupt.
When "1" is read out : Interrupt has occurred
When "0" is read out : Interrupt has not occurred
Writing : Invalid
The interrupt factor flags (SWIT0, SWIT1) correspond to the 10 Hz and 1 Hz interrupts respectively. With
these flags, the software can judge whether a stopwatch timer interrupt has occurred. However, regard-
less of the interrupt mask register setting, these flags are set to "1" by the counter overflow.
These flags are reset when read out by the software. Also, read-out is only possible in the DI status
(interrupt flag = "0").
At initial reset, these flags are set to "0".
SWRST: Stopwatch timer reset (2EEHD1)
This bit resets the stopwatch timer.
When "1" is written : Stopwatch timer reset
When "0" is written : No operation
Read-out : Always "0"
The stopwatch timer is reset when "1" is written to SWRST. When the stopwatch timer is reset in the RUN
status, operation restarts immediately. Also, in the STOP status the reset data is maintained.
This bit is write-only, and is always "0" at read-out.
SWRUN: Stopwatch timer RUN/STOP (2EEHD2)
This bit controls RUN/STOP of the stopwatch timer.
When "1" is written : RUN
When "0" is written : STOP
Read-out : Valid
The stopwatch timer enters the RUN status when "1" is written to SWRUN, and the STOP status when "0"
is written.
In the STOP status, the timer data is maintained until the next RUN status or resets timer. Also, when the
STOP status changes to the RUN status, the data that was maintained can be used for resuming the count.
When the timer data is read out in the RUN status, correct read-out may be impossible because of the
carry from the low-order bit (SWL) to the high-order bit (SWH). This occurs when read-out has extended
over the SWL and SWH bits when the carry occurs. To prevent this, perform read out after entering the
STOP status, and then return to the RUN status. Also, the duration of the STOP status must be within 976
sec (256 Hz 1/4 cycle).
At initial reset, this register is set to "0".
4.10.5 Programming notes
(1) If timer data is read out in the RUN status, the timer must be made into the STOP status, and after
data is read out the RUN status can be restored. If data is read out when a carry occurs, the data
cannot be read correctly.
Also, the processing above must be performed within the STOP interval of 976 sec (256 Hz 1/4
cycle).
(2) Read-out of the interrupt factor flag (SWIT) must be done only in the DI status (interrupt flag = "0").
Read-out during EI status (interrupt flag = "1") will cause malfunction.