42
EPSON
E0C6006 TECHNICAL MANUAL
CHAPTER 4: PERIPHERAL CIRCUITS AND OPERATION (Interrupt and HALT)
4.10 Interrupt and HALT
The E0C6006 has a total of six interrupt functions: two external input interrupts, three internal timer
interrupts, and one remote control (REM) interrupt. Each of them can be masked. To enable an interrupt,
the interrupt flag must be enabled (set to "1"). Upon occurrence of an interrupt, the flag is disabled (set to
"0").
When an interrupt occurs, the address of the next program to execute is saved into the stack (RAM) and
the program counter is set to the interrupt vector (page 1, steps 01H to 0FH) depending on the interrupt
factor. (These processes require a time of 12 clocks.) All subsequent processing is controlled by the
software written in the interrupt vector.
Execution of the HALT instruction stops the CPU clock of the E0C6006 to halt the CPU. An interrupt
enables it to restart from the halt state. If the CPU can not restart, because dose not detect an interrupt, it
restarts from initial reset state under watchdog timer control.
Table 4.10.1 I/O memory map
Address
Comment
D3
D2
Register
D1
D0
Name
Init
∗
1
1
0
0F2H
REMC
EIREM
EIK1
EIK0
R/W
REMC
EIREM
EIK1
EIK0
1
0
0
0
On
Enable
Enable
Enable
Off
Mask
Mask
Mask
REM carrier generation on/off
Interrupt mask register (REM)
Interrupt mask register (K10–K13)
Interrupt mask register (K00–K03)
0F0H
REMSO
IREM
IK1
IK0
R/W
R
REMSO
IREM
∗
4
IK1
∗
4
IK0
∗
4
0
–
∗
5
0
0
On
Yes
Yes
Yes
Off
No
No
No
Forced REM output (on/off)
Interrupt factor flag (REM)
Interrupt factor flag (K10–K13)
Interrupt factor flag (K00–K03)
0F3H
TMRUN
EIT2
EIT8
EIT32
R/W
TMRUN
EIT2
EIT8
EIT32
0
0
0
0
Run
Enable
Enable
Enable
Reset,Stop
Mask
Mask
Mask
Timer run/reset & stop
Interrupt mask register (clock timer 2 Hz)
Interrupt mask register (clock timer 8 Hz)
Interrupt mask register (clock timer 32 Hz)
0F1H
WDRST
IT2
IT8
IT32
W
R
WDRST
IT2
∗
4
IT8
∗
4
IT32
∗
4
Reset
0
0
0
Reset
Yes
Yes
Yes
–
No
No
No
Watchdog timer reset
Interrupt factor flag (clock timer 2 Hz)
Interrupt factor flag (clock timer 8 Hz)
Interrupt factor flag (clock timer 32 Hz)
∗
1
∗
2
Initial value at initial reset
Not set in the circuit
∗
5 Undefined
∗
3
∗
4
Always "0" being read
Reset (0) immediately after being read
4.10.1 Interrupt request
An interrupt request is caused by one of the following factors:
Table 4.10.1.1 Interrupt factor and interrupt factor flag
Interrupt factor
Falling edge of 2 Hz timer signal
Falling edge of 8 Hz timer signal
Falling edge of 32 Hz timer signal
REM control
Falling edge of input (K10–K13)
Falling edge of input (K00–K03)
Interrupt factor flag
TI2
TI8
TI32
IREM
IK1
IK0
(0F1H•D2)
(0F1H•D1)
(0F1H•D0)
(0F0H•D2)
(0F0H•D1)
(0F0H•D0)
An interrupt factor sets the corresponding interrupt factor flag (read-only register) to "1". When its data is
read, the register is reset to "0". At initial reset, it is reset to "0". (However, the value of the REM interrupt
factor flag (IREM) is undefined at initial reset.)
When the interrupt factor flag is set to "1" with both the corresponding interrupt mask register and
interrupt flag set at "1", an interrupt request to the CPU is generated.
Reading of interrupt factor flags is available at EI, but be careful in the following cases.
If the interrupt mask register value corresponding to the interrupt factor flag to be read is set to "1", an
interrupt request will be generated by the interrupt factor flag set timing, or an interrupt request will not
be generated. Be very careful when interrupt factor flags are in the same address.