Epson S1C17624 Technical Manual page 180

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

16 STOPWaTCh TiMeR (SWT)
notes: • The SWT module interrupt flag must be reset in the interrupt handler routine after a stopwatch
timer interrupt has occurred to prevent recurring interrupts.
• Reset the interrupt flag before enabling SWT interrupts with the interrupt enable bit to prevent
occurrence of unwanted interrupt. The interrupt flag is reset by writing 1.
16.7
Control Register Details
address
0x5020
SWT_CTL
0x5021
SWT_BCNT
0x5022
SWT_IMSK
0x5023
SWT_IFLG
The SWT registers are described in detail below. These are 8-bit registers.
note: When data is written to the registers, the "Reserved" bits must always be written as 0 and not 1.
Stopwatch Timer Control Register (SWT_CTl)
Register name address
Bit
Stopwatch
0x5020
D7–5 –
Timer Control
(8 bits)
D4
Register
D3–1 –
(SWT_CTl)
D0
D[7:5]
Reserved
D4
SWTRST: Stopwatch Timer Reset Bit
Resets the SWT module.
1 (W):
Reset
0 (W):
Ignored
0 (R):
Always 0 when read (default)
Writing 1 to this bit resets the counter to 0x0. When reset in Run state, the timer restarts immediately
after resetting. The reset data 0x0 is retained when in Stop state.
D[3:1]
Reserved
D0
SWTRun: Stopwatch Timer Run/Stop Control Bit
Controls the timer Run/Stop.
1 (R/W): Run
0 (R/W): Stop (default)
The timer starts counting when SWTRUN is written as 1 and stops when written as 0. The counter data
is retained at Stop state until a reset or the next Run state.
Stopwatch Timer BCD Counter Register (SWT_BCnT)
Register name address
Bit
Stopwatch
0x5021
D7–4 BCD10[3:0] 1/10 sec. BCD counter value
Timer BCD
(8 bits)
Counter Register
D3–0 BCD100[3:0] 1/100 sec. BCD counter value
(SWT_BCnT)
D[7:4]
BCD10[3:0]: 1/10 Sec. BCD Counter Value Bits
The 1/10-second counter BCD data can be read out. (Default: 0)
This register is read-only and cannot be written to.
D[3:0]
BCD100[3:0]: 1/100 Sec. BCD Counter Value Bits
The 1/100-second counter BCD data can be read out. (Default: 0)
This register is read-only and cannot be written to.
16-4
Table 16.
7.1 List of SWT Registers
Register name
Stopwatch Timer Control Register
Stopwatch Timer BCD Counter Register
Stopwatch Timer Interrupt Mask Register
Stopwatch Timer Interrupt Flag Register
name
Function
reserved
SWTRST
Stopwatch timer reset
reserved
SWTRun
Stopwatch timer run/stop control
name
Function
Seiko epson Corporation
Function
Resets and starts/stops the timer.
BCD counter data
Enables/disables interrupt.
Indicates/resets interrupt occurrence status.
Setting
init. R/W
1 Reset
0 Ignored
1 Run
0 Stop
Setting
init. R/W
0 to 9
0 to 9
S1C17624/604/622/602/621 TeChniCal Manual
Remarks
0 when being read.
0
W
0
R/W
Remarks
0
R
0
R

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17604S1c17622S1c17602S1c17621

Table of Contents