- UID
- 1062083
- 性别
- 男
|
实验内容: 编写试验程序,通过单片机P0口控制步进电机运转,接线图和各步电平见下。
参考程序:
ORG 0000H
LJMP MAIN
ORG 0030H
MAIN: MOV R1,#08H
MOV DPTR,#TAB
LOOP: CLR A
MOVC A,@A+DPTR
MOV P0,A
INC DPTR
LCALL DELAY
DJNZ R1,LOOP
AJMP MAIN
TAB: DB 0EH,0CH,0DH,09H,0BH,03H,07H,06H
DELAY: MOV R5,#0FEH
DELAY1: MOV R4,#0FFH
DELAY2: DJNZ R4,DELAY2
DJNZ R5,DELAY1
RET
END |
|