哪位高手能帮我看看这个用51单片机汇编语言编写的简易电子音乐盒哪出了问题?
在用RPOTEUS仿真的时候80C51单片机的INT0口我接了个地和一个开关,也就是按一下开关,INTO口置零一次。但在仿真的时候却好像INT0口置不了零,即使是按下开关...
在用RPOTEUS仿真的时候80C51单片机的INT0口我接了个地和一个开关,也就是按一下开关,INTO口置零一次。但在仿真的时候却好像INT0口置不了零,即使是按下开关接地其也一直都是高电平,另外在仿真时扬声器没有声音出来!!
ORG 0000H
LJMP MAIN
ORG 000BH
LJMP SEV
ORG 0030H
MAIN:
MOV TMOD,#01H
MOV IE,#87H
STA: MOV 30H,#00H
NEXT:MOV DPTR,#FIRST
MOV A,30H
MOVC A,@A+DPTR
MOV R2,A
CJNE A,#00H,NEXT1
CLR TR0
SJMP STA
NEXT1: MOV A,R2
ANL A,#0FH
MOV R3,A
MOV A,R2
SWAP A
ANL A,#0FH
JNZ SING
CLR TR0
SJMP D1
SING:DEC A
CLR C
RL A
MOV 22H,A
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV TH0,A
MOV 21H,A
MOV A,22H
ADD A,#1H
MOVC A,@A+DPTR
MOV TL0,A
MOV 20H,A
SETB ET0
SETB TR0
D1: LCALL DELAY
CLR TR0
INC 30H
SJMP NEXT
SEV: CPL P1.0
RETI
DELAY: MOV R7,#05
D2: MOV R6,#250
D3:MOV R5,#74
D30: DJNZ R5,D30
DJNZ R6,D3
DJNZ R7,D2
DJNZ R3,DELAY
RETI
FIRST:DB 82H,01H,81H,94H,84H,0B4H,0A4H,04H
DB 82H,01H,81H,94H,84H,0C4H,0B4H,04H
DB 82H,01H,81H,0F4H,0D4H,0B4H,0A4H,94H
DB 0E2H,01H,0E1H,0D4H,0B4H,0C4H,0B4H,04H
TABLE:DW 62991,63268,63515,63631,63838,64023,64107,64264
DW 64402,64526,64584,64682,65058,65110,65157,65178
END
没财富值了,不好意思啊!!没分给大家了~~ 展开
ORG 0000H
LJMP MAIN
ORG 000BH
LJMP SEV
ORG 0030H
MAIN:
MOV TMOD,#01H
MOV IE,#87H
STA: MOV 30H,#00H
NEXT:MOV DPTR,#FIRST
MOV A,30H
MOVC A,@A+DPTR
MOV R2,A
CJNE A,#00H,NEXT1
CLR TR0
SJMP STA
NEXT1: MOV A,R2
ANL A,#0FH
MOV R3,A
MOV A,R2
SWAP A
ANL A,#0FH
JNZ SING
CLR TR0
SJMP D1
SING:DEC A
CLR C
RL A
MOV 22H,A
MOV DPTR,#TABLE
MOVC A,@A+DPTR
MOV TH0,A
MOV 21H,A
MOV A,22H
ADD A,#1H
MOVC A,@A+DPTR
MOV TL0,A
MOV 20H,A
SETB ET0
SETB TR0
D1: LCALL DELAY
CLR TR0
INC 30H
SJMP NEXT
SEV: CPL P1.0
RETI
DELAY: MOV R7,#05
D2: MOV R6,#250
D3:MOV R5,#74
D30: DJNZ R5,D30
DJNZ R6,D3
DJNZ R7,D2
DJNZ R3,DELAY
RETI
FIRST:DB 82H,01H,81H,94H,84H,0B4H,0A4H,04H
DB 82H,01H,81H,94H,84H,0C4H,0B4H,04H
DB 82H,01H,81H,0F4H,0D4H,0B4H,0A4H,94H
DB 0E2H,01H,0E1H,0D4H,0B4H,0C4H,0B4H,04H
TABLE:DW 62991,63268,63515,63631,63838,64023,64107,64264
DW 64402,64526,64584,64682,65058,65110,65157,65178
END
没财富值了,不好意思啊!!没分给大家了~~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询