232
CHAPTER 11 EXTERNAL INTERRUPT CIRCUIT (EDGE)
11.6
Program Example for the External Interrupt Circuit
This section gives a program example for the external interrupt circuit.
■
Program example for the external interrupt circuit
●
Processing description
•
Generates interrupts on detecting a rising edge on pulses input to the INT1 pin.
●
Coding example
EIC1 EQU 0030H ; External interrupt control register 1
EIR1 EQU EIC1:7 ; Defines the external interrupt request flag bit.
SL10 EQU EIC1:5 ; Defines the edge polarity selection bit.
EIE1 EQU EIC1:4 ; Defines the interrupt request enable bit.
ILR1 EQU 007CH ; Set interrupt level setting register 1.
INT_V DSEG ABS ; [DATA SEGMENT]
ORG 0FFF8H
IRQ1 DW WARI ; Set INT1 interrupt vector.
INT_V ENDS
;-----Main program----------------------------------------------------------------
CSEG ; [CODE SEGMENT]
; Stack pointer (SP) etc. are already initialized.
:
CLRI ; Disable interrupts.
CLRB EIR1 ; Clear interrupt request flag.
MOV ILR1,#11110111B ; Set interrupt level (level 1).
SETB SL10 ; Select rising edge.
SETB EIE1 ; Enable output of interrupt requests.
SETI ; Enable interrupts.
:
;-----Interrupt processing routine------------------------------------------------
WARI CLRB EIE1 ; Clear INT1 interrupt request flag.
PUSHW A
XCHW A,T
PUSHW A
:
User processing
:
POPW A
XCHW A,T
POPW A
RETI
ENDS
;---------------------------------------------------------------------------------
END
Содержание MB89950 Series
Страница 2: ......
Страница 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Страница 4: ......
Страница 10: ...vi ...
Страница 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Страница 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Страница 236: ...222 CHAPTER 10 UART ...
Страница 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Страница 310: ...296 APPENDIX ...
Страница 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Страница 316: ...302 INDEX ...
Страница 318: ......