![](http://datasheet.mmic.net.cn/330000/MB90F562_datasheet_16437954/MB90F562_187.png)
MB90560 series
CHAPTER 6 INTERRUPTS
163
I
Processing specifications of sample program for extended intelligent I/O service (EI
2
OS)
1)This program detects the H level signal input to the INT0 pin and activates the extended
intelligent I/O service (EI
2
OS).
2)When the H level is input to the INT0 pin, EI
2
OS is activated. Data is transferred from port 0 to
the memory at the 3000
H
address.
3)The number of transfer data bytes is 100 bytes. After 100 bytes are transferred, an interrupt is
generated because EI
2
OS transfer has terminated.
G
Sample coding
DDR1
ENIR
ENRR
ELVR
ICR00
BAPL
BAPM
BAPH
ISCS
IOAL
IOAH
DCTL
DCTH
ER0
STACK
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
SSEG
RW
RW
ENDS
000011H
000030H
000031H
000032H
0000B0H
000100H
000101H
000102H
000103H
000104H
000105H
000106H
000107H
ENRR:0
;
;
;
;
;
;
;
;
;
;
;
;
;
;
;
Port 1-direction register
Interrupt/DTP enable register
Interrupt/DTP factor register
Request level setting register
Interrupt control register
Lower buffer address pointer
Middle buffer address pointer
Upper buffer address pointer
EI
2
OS status
Lower I/O address pointer
Upper I/O address pointer
Low-order data counter
High-order data counter
Definition of external interrupt request flag bit
Stack
100
1
STACK_T
STACK
;-------------------Main program------------------------------------------------------------------------------------------
CODECSEG
START:
AND
CCR, #0BFH
;
;
;
;
Clears the I flag of the CCR in the PS and
prohibits interrupts.
Sets the register bank pointer.
Sets the system stack.
MOV
MOV
MOV
MOVW
MOVW
MOV
MOV
MOV
MOV
MOV
RP, #00
A, #STACK_T
SSB, A
A, #STACK_T
SP, A
I:DDR1, #00000000B ; Sets the P10/INT0 pin to input.
BAPL, #00H
;
Sets the buffer address (003000H).
BAPM, #30H
BAPH, #00H
ISCS, #00010001B
;
No I/O address update, byte transfer,
;
buffer address updated
;
I/O
→
buffer transfer, terminated by the
;
peripheral function.
IOAL, #00H
;
Sets the transfer source address
;
(port 0: 000000H).
IOAH, #00H
DCTL, #64H
;
Sets the number of transfer bytes (100 bytes).
DCTH, #00H
I:ICR00, #00001000B ;
EI
2
OS channel 0, EI
2
OS enable,
;
interrupt level 0 (highest priority)
I:ELVR, #00000001B ;
Requests that INT0 be made H level.
I:ENRR, #00H
;
Clears the INT0 interrupt cause.
I:ENIR, #01H
;
Enables INT0 interrupts.
ILM, #07H
;
Sets the ILM in the PS to level 7.
CCR, #40H
;
Sets the I flag of the CCR in the PS
;
and enables interrupts.
;
;
Sets the stack pointer, then
Sets SSP because the S flag = 1.
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
MOV
OR