proteus仿真中数码管不亮
电路设计程序设计ORG0000HLJMPMAINORG0100HMAIN:MOVR3,#192/*步进角为5.625度,一圈360度,需要64个脉冲完成,3*64=192...
电路设计
程序设计
ORG 0000H
LJMP MAIN
ORG 0100H
MAIN:
MOV R3,#192 /*步进角为 5.625度,一圈360度,需要64个脉冲完成,3*64=192*/
START: /*正转*/
MOV R0,#00H
START1:
MOV P2,#00H
MOV A,R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
JZ START
MOV P2,A
LCALL DELAY
INC R0
DJNZ R3,START1
MOV P2,#00H /*正转*/
LCALL DELAY1
MOV R3,#192
START2:
MOV P2,#00H
MOV R0,#05
START3:
MOV A,R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
JZ START2
MOV P2,A
CALL DELAY
INC R0
DJNZ R3,START3
MOV P2,#00H
LCALL DELAY1
LJMP MAIN
DELAY: MOV R7,#40
M3: MOV R6,#248
DJNZ R6,$
DJNZ R7,M3
RET
DELAY1: MOV R4,#50 /*5秒延时*/
DEL2: MOV R3,#100
DEL3: MOV R2,#255
DJNZ R2,$
DJNZ R3,DEL3
DJNZ R4,DEL2
RET
TABLE:
DB 03H,06H,0CH,09H
DB 00
DB 03H,09H,0CH,06H
DB 00
END
(按照别人的实例做的,但是数码管仿真不出来结果,求指点) 展开
程序设计
ORG 0000H
LJMP MAIN
ORG 0100H
MAIN:
MOV R3,#192 /*步进角为 5.625度,一圈360度,需要64个脉冲完成,3*64=192*/
START: /*正转*/
MOV R0,#00H
START1:
MOV P2,#00H
MOV A,R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
JZ START
MOV P2,A
LCALL DELAY
INC R0
DJNZ R3,START1
MOV P2,#00H /*正转*/
LCALL DELAY1
MOV R3,#192
START2:
MOV P2,#00H
MOV R0,#05
START3:
MOV A,R0
MOV DPTR,#TABLE
MOVC A,@A+DPTR
JZ START2
MOV P2,A
CALL DELAY
INC R0
DJNZ R3,START3
MOV P2,#00H
LCALL DELAY1
LJMP MAIN
DELAY: MOV R7,#40
M3: MOV R6,#248
DJNZ R6,$
DJNZ R7,M3
RET
DELAY1: MOV R4,#50 /*5秒延时*/
DEL2: MOV R3,#100
DEL3: MOV R2,#255
DJNZ R2,$
DJNZ R3,DEL3
DJNZ R4,DEL2
RET
TABLE:
DB 03H,06H,0CH,09H
DB 00
DB 03H,09H,0CH,06H
DB 00
END
(按照别人的实例做的,但是数码管仿真不出来结果,求指点) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询