我正在使用 Atmega8535 微控制器和 STK200 开发板,我试图使用多个外部中断,但由于某种原因,只有 INT0 工作,其他人什么都不做,这里是相关代码:
;Interrupt Vector Addresses
.equ INT0addr=$001 ;External Interrupt0 Vector Address
.equ INT1addr=$002
.equ INT2addr=$003
.equ INT3addr=$004
.equ INT4addr=$005
//interrupts
.org INT0addr
rjmp INT0 ;External Interrupt0 Vector
.org $0015 ;Program address
.org INT1addr
rjmp INT1 ;External Interrupt1 Vector
.org $0015 ;Program address
.org INT2addr
rjmp INT2 ;External Interrupt0 Vector
.org $0017
.org INT3addr
rjmp INT3 ;External Interrupt0 Vector
.org $0018
.org INT4addr
rjmp INT4 ;External Interrupt0 Vector
.org $0019
;External Interrupt0 Service Routine
INT0: cli ;Prevent any more interrupts while ISR is running
rjmp reset
reti ;Return and enable interrupts again
;External Interrupt1 Service Routine
INT1: cli ;Prevent any more interrupts while ISR is running
rjmp reset
reti ;Return and enable interrupts again
;External Interrupt1 Service Routine
INT2: cli ;Prevent any more interrupts while ISR is running
rjmp reset
reti ;Return and enable interrupts again
;External Interrupt1 Service Routine
INT3: cli ;Prevent any more interrupts while ISR is running
rjmp reset
reti ;Return and enable interrupts again
;External Interrupt1 Service Routine
INT4: cli ;Prevent any more interrupts while ISR is running
rjmp reset
reti ;Return and enable interrupts again