mode equ 082h
ctl equ 08000h
contrl equ 08003h
contr2 equ 08001h
Astep equ 01h
Bstep equ 02h
Cstep equ 04h
Dstep equ 08h
data segment
dly_c dw 0
data ends
code segment
assume cs:code, ds:data
start proc near
mov ax, data
mov ds, ax
mov dx, contrl
mov al, mode
out dx, al
mov dx, ctl
mov al,0
out dx,al
mov dly_c,1000h
mov dx,contr2
in al,dx
and al,00000011b
cmp al,01h
jz step4
cmp al,00h
jz step41
jmp step4
; 单/双八拍工作方式
; 双四拍工作方式//实现正转
step4:
mov dx, ctl
mov al,Astep+Bstep
out dx,al
call delay
mov al,Bstep+Cstep
out dx,al
call delay
mov al,Cstep+
lab8000接口课程设计-步进电机控制
最新推荐文章于 2021-02-23 16:44:42 发布