伺服馬達測試 (型號S3003
IC: 89s51
軟體:Keil uVision4
請問有大大可以幫我寫一個伺服馬達的測試程式嗎
我用組合語言寫 (請各位幫我看一下 拜託一
PUR REG P3.6 ;右馬達 可是這2個宣告~ 他說語法錯誤
PUL REG P3.7 ;左馬達 可是這2個宣告~ 他說語法錯誤
DEA EQU 3 ;馬達正轉
DEB EQU 25 ;馬達逆轉
T11 EQU 10
T12 EQU 20
;----------------------------------------
ORG 0H
JMP START
START:
CALL ALON
JMP START
PUR_ALONG:
SETB PUR
MOV R4,#DEA
G1:
CALL DEALY1
DJNZ R4,G1
CLR PUR
MOV R4,#(200-DEA)
G2:
CALL DEALY1
DJNZ R4,G2
RET
PUL_ALONG:
SETB PUL
MOV R4,#DEA
G11:
CALL DEALY1
DJNZ R4,G11
CLR PUL
MOV R4,#(200-DEA)
G12:
CALL DEALY1
DJNZ R4,G12
RET
ALON:
MOV R3,#T11
ALON1: CALL PUR_ALONG
CALL PUL_ALONG
DJNZ R3,ALON1
RET |