实验内容:
编写实验程序,经过单片机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