INTERRUPT
6-37
n
Program example for EI
2
OS program
(1) The EI
2
OS is started by detecting the H level of the signal input to the
INT0
pin.
(2) When the H level is input to the
INT0
pin, EI
2
OS is started and the data of port 0 is transferred to
memory address 3000
H
.
(3) The transfer data byte count is 100. After 100 bytes are transferred, an interrupt is generated by
termination of the EI
2
OS transfer.
•
Coding example
DDR1
EQU
000011
H
;
Port 1 direction register
ENIR
EQU
000030
H
;
Interrupt/DTP enable register
EIRR
EQU
000031
H
;
Interrupt/DTP factor register
ELVR
EQU
000032
H
;
Request level setting register
ICR00
EQU
0000B0
H
;
Interrupt control register 00
BAPL
EQU
000100
H
;
Lower of buffer address pointer
BAPM
EQU
000101
H
;
Middle of buffer address pointer
BAPH
EQU
000102
H
;
Upper of buffer address pointer
ISCS
EQU
000103
H
;
EI2OS status
IOAL
EQU
000104
H
;
Lower of I/O address pointer
IOAH
EQU
000105
H
;
Upper of I/O address pointer
DCTL
EQU
000106
H
;
Lower of data counter
DCTH
EQU
000107
H
;
Upper of data counter
ERO
EQU
EIRR:0
;
External interrupt request flag bit defined
STACK
SSEG
;
Stack
RW
100
STACK_T
RW
1
STACK
ENDS
; - - - - - Main program - - - - - - - - - - - - - - - - - - - - - - - - -
CODE
CSEG
START:
AND
CCR,#0BF
H
;
I flag of CCR in PS cleared to disable interrupt
MOV
RP,#00
;
Register bank pointer set
MOV
A,#!STACK_T
;
System stack set
MOV
SSB,A
MOVW
A,#STACK_T
;
Stack pointer set
MOVW
SP,A
;
In this case, S flag = 1, so SSP set
MOV
I:DDR1,#00000000
B
;
Set P10/INT0 pin to input
MOV
BAPL,#00
H
;
Buffer address set (003000
H
)
MOV
BAPM,#30
H
MOV
BAPH,#00
H
MOV
ISCS,#00010001
B
;
I/O Address not updated, byte transfer performed, and buffer address
updated
;
Data transferred from I/O to buffer, and termination by resource
MOV
IOAL,#00
H
;
Transfer destination address set (port 0: 000000
H
)
MOV
IOAH,#00
H
MOV
DCTL,#64
H
;
Transfer byte count set (100 bytes)
MOV
DCTH,#00
H
MOV
I:ICR00,#00001000
B
;
EI2OS channel = 0, EI2OS enabled, and interrupt level 0 (highest)
MOV
I:ELVR,#00000001
B
;
Set
INT0 as an H-level request
MOV
I:EIRR,#00
H
;
INT0 interrupt factor cleared
MOV
I:ENIR,#01
H
;
INT0 interrupt enabled
MOV
ILM,#07
H
;
ILM in PS set to level 7
OR
CCR,#40
H
;
I flag of CCR in PS set to enable the interrupt
:
LOOP:
BRA
LOOP
;
Infinite loop
Содержание MB90420/5 (A) Series
Страница 2: ...ii ...
Страница 24: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 1 2 ...
Страница 42: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 2 2 ...
Страница 76: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 2 36 ...
Страница 78: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 3 2 ...
Страница 90: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 4 2 ...
Страница 102: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 4 14 ...
Страница 104: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 5 2 ...
Страница 126: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 5 24 ...
Страница 128: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 6 2 ...
Страница 165: ...7 1 Mode Setting 7 3 7 2 Mode Pins MD2 to MD0 7 4 7 3 Mode Data 7 5 7 MODE SETTING ...
Страница 166: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 7 2 ...
Страница 172: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 8 2 ...
Страница 224: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 9 2 ...
Страница 244: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 10 2 ...
Страница 270: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 11 2 ...
Страница 286: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 12 2 ...
Страница 326: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 13 2 ...
Страница 338: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 14 2 ...
Страница 353: ...LCD CONTROLLER DRIVER 14 17 ...
Страница 365: ...LCD CONTROLLER DRIVER 14 29 ...
Страница 367: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 15 2 ...
Страница 377: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 16 2 ...
Страница 397: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 17 2 ...
Страница 400: ...18 1 Overview of Timepiece Timer 18 3 18 2 Timepiece Timer Registers 18 4 18 TIMEPIECE TIMER ...
Страница 401: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 18 2 ...
Страница 409: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 19 2 ...
Страница 436: ...20 1 Overview of Sound Generator 20 3 20 2 Sound Generator Registers 20 4 20 SOUND GENERATOR ...
Страница 437: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 20 2 ...
Страница 445: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 20 10 ...
Страница 446: ...21 1 Overview of ROM Correction 21 3 21 2 Application Example of ROM Correction 21 6 21 ROM CORRECTION ...
Страница 447: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 21 2 ...
Страница 455: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 21 10 ...
Страница 457: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 22 2 ...
Страница 461: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 23 2 ...
Страница 503: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 23 44 ...
Страница 505: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 24 2 ...
Страница 513: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 24 10 ...
Страница 515: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 25 2 ...
Страница 541: ...MB90420 5 A SERIES F2 MC 16LX FAMILY 16 BIT MICROCONTROLLERS HARDWARE MANUAL 26 2 ...