电动机,dsPIC,自动控制,程序
《步进电动机实现两轴联动直线运动程序》
.equ __30F6010, 1
.include "C:\Program Files\Microchip\MPLAB ASM30 Suite\Support\inc\p30f6010.inc" .global __reset
.global __OC7Interrupt
.global __OC8Interrupt
config __FOSC, CSW_FSCM_OFF & XT_PLL4
config __FWDT, WDT_OFF
config __FBORPOR, PBOR_ON & BORV_27 & PWRT_16 & MCLR_EN
config __FGS, CODE_PROT_OFF
.bss
XAL: .space 2
XBL: .space 2
YAL: .space 2
YBL: .space 2
XAH: .space 2
XBH: .space 2
YAH: .space 2
YBH: .space 2
tL: .space 2
tH: .space 2 ;
K: .space 2
dXL: .space 2
dYL: .space 2
dXH: .space 2
dYH: .space 2
Tx: .space 2
Ty: .space 2
DIR: .space 2
NXL: .space 2
NXH: .space 2
NYL: .space 2
NYH: .space 2
Testx: .space 2
Testy: .space 2
.text
__reset:
mov #__SP_init, W15
mov #__SPLIM_init, W0
mov W0, SPLIM
nop
clr W0
mov W0, W14
repeat #12