用89C51控制2相步进电机,按一次仿真器按键"运行",电机反向进两步,按6次就转360度,如想设成转动一步,程序应怎样修改? 在本主题的22楼,即后一页可以看到本人发的时序图和原理图
loop:
mov p0,#0f9h call delay
mov p0,#0fCh call delay
mov p0,#0f6h call delay
mov p0,#0f3h call delay
;---------------------------------------------- mov p0,#0f3h call delay
mov p0,#0f6h call delay
mov p0,#0fCh call delay
mov p0,#0f9h call delay
ajmp loop
DELAY: MOV R7,#100 D1: MOV R6,#250 D2: DJNZ R6,D2 DJNZ R7,D1 RET
end |