16 STOPWATCH TIMER (SWT)
16-6
EPSON
S1C17704 TECHNICAL MANUAL
16.6 Stopwatch Timer Interrupt
The SWT module can generate the following three types of interrupts:
• 100 Hz interrupt
• 10 Hz interrupt
• 1 Hz interrupt
The SWT module has one interrupt signal to be output to the interrupt controller (ITC) and it is shared with the
three causes of interrupt. To determine the cause of interrupt that has occurred, read the interrupt flags in the SWT
module.
100 Hz, 10 Hz, and 1 Hz interrupts
An interrupt request occurs at the falling edge of the 100 Hz (approximate 100 Hz), 10 Hz (approximate 10
Hz), and 1 Hz signals, and it sets the interrupt flag in the SWT module to 1.
∗
SIF1
: 1 Hz Interrupt Flag in the Stopwatch Timer Interrupt Flag (SWT_IFLG) Register (D2/0x5023)
∗
SIF10
: 10 Hz Interrupt Flag in the Stopwatch Timer Interrupt Flag (SWT_IFLG) Register (D1/0x5023)
∗
SIF100
: 100 Hz Interrupt Flag in the Stopwatch Timer Interrupt Flag (SWT_IFLG) Register (D0/0x5023)
Set the interrupt enable bit corresponding to the interrupt flag to 1 when using the interrupt. If the interrupt
enable bit is set to 0 (default), the interrupt flag will not be set to 1 and an interrupt request by the corresponding
signal will not be sent to the ITC.
∗
SIE1
: 1 Hz Interrupt Enable Bit in the Stopwatch Timer Interrupt Mask (SWT_IMSK) Register (D2/0x5022)
∗
SIE10
: 10 Hz Interrupt Enable Bit in the Stopwatch Timer Interrupt Mask (SWT_IMSK) Register (D1/0x5022)
∗
SIE100
: 100 Hz Interrupt Enable Bit in the Stopwatch Timer Interrupt Mask (SWT_IMSK) Register (D0/0x5022)
If
SIF
∗
is set to 1, the SWT module outputs the interrupt request signal to the ITC. The interrupt request signal
sets the stopwatch timer interrupt flag in the ITC to 1 and an interrupt occurs if other interrupt conditions meet
the ITC and S1C17 Core settings.
The stopwatch timer interrupt handler routine should read the SIF* flags to check the signal that causes
occurrence of the interrupt.
Furthermore, the interrupt handler routine must reset (write 1 to) SIF
∗
in the SWT module, not the stopwatch
timer interrupt flag in the ITC, to clear the cause of interrupt.
Note
: To avoid occurrence of unnecessary interrupts, be sure to reset the SIF
∗
flags before the
stopwatch timer interrupt is enabled using SIE
∗
.
ITC registers for stopwatch timer interrupt
The stopwatch timer asserts the interrupt signal sent to the ITC at the falling edge of the signal whose interrupt
is enabled according to the interrupt condition settings shown above. To generate a stopwatch timer interrupt,
set the interrupt level and enable the interrupt using the ITC registers.
The following shows the control bits for the stopwatch timer interrupt in the ITC.
Interrupt flag in the ITC
∗
EIFT2
: Stopwatch Timer Interrupt Flag in the Interrupt Flag (ITC_IFLG) Register (D2/0x4300)
Interrupt enable bit in the ITC
∗
EIEN2
: Stopwatch Timer Interrupt Enable Bit in the Interrupt Enable (ITC_EN) Register (D2/0x4302)
Interrupt level setup bits in the ITC
∗
EILV2[2:0]
: SWT Interrupt Level Bits in the External Interrupt Level Setup (ITC_ELV1) Register 1
(D[2:0]/0x4308)
Interrupt trigger mode select bit in the ITC (fixed at 1)
∗
EITG2
: SWT Interrupt Trigger Mode Select Bit in the External Interrupt Level Setup (ITC_ELV1) Register 1
(D4/0x4308)
Содержание S1C17704
Страница 1: ...TECHNICAL MANUAL S1C17704 CMOS 16 BIT SINGLE CHIP MICROCOMPUTER ...
Страница 22: ...1 OVERVIEW 1 10 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 42: ...3 MEMORY MAP BUS CONTROL 3 12 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 82: ...6 INTERRUPT CONTROLLER ITC 6 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 108: ...8 CLOCK GENERATOR CLG 8 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 112: ...9 PRESCALER PSC 9 4 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 138: ...10 I O PORTS P 10 26 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 156: ...11 16 BIT TIMERS T16 11 18 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 208: ...14 8 BIT OSC1 TIMER T8OSC1 14 16 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 234: ...16 STOPWATCH TIMER SWT 16 14 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 242: ...17 WATCHDOG TIMER WDT 17 8 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 264: ...18 UART 18 22 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 300: ...20 I2C 20 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 320: ...21 REMOTE CONTROLLER REMC 21 20 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 360: ...24 ON CHIP DEBUGGER DBG 24 6 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...
Страница 362: ...25 BASIC EXTERNAL WIRING DIAGRAM 25 2 EPSON S1C17704 TECHNICAL MANUAL THIS PAGE IS BLANK ...