用51单片机实现外围设备中断
扫描二维码
随时随地手机看文章
有5台外围设备,分别为EX1~EX5,均需要中断。现要求EX1与EX2的优先级为高,其他的优先级为低,请用51单片机实现,要求画出电路图并编制程序(假设中断信号为低电平),要执行相应的中断服务子程序WORK1~WORK5。
org0000h
ljmpmain
org0003h
ljmpint0_int
org0013h
ljmpint1_int
org0030h
main:movsp,#60h
orltcon,#00000101b
movie,#10000101b
movip,#000000001b
orlp1,#00011111b
sjmp$
int0_int: jbp1.0,work1
jbp1.1,work2
reti
int1_int: jbp1.2,work3
jbp1.3,work4
jbp1.4,work5
reti
work1:......
reti
work2:......
reti
work3:......
reti
work4:......
reti
work5:......
reti
end