assembly code motor drive
hey,
I'm currently using the SLA7062M unipolar stepper motor driver/translator . I' would like to ask as about that, how can i control this chip with microcontroler-PIC.
I use the PIC16F876 and i've clock frequency 10MHz for timing. So, the instruction word is tc= 0,4 μsec. More over, i saw the picture with name "logic input timing" in datashet of SLA7062M on page 4.
could you write a simple code in assembly code which is possible to move stepper motor???
John,
Added after 36 seconds:
As well as, i have write the following in assembly code but, it isn't work
:
;**************** arxh programmatos ***********************
ORG H'20' ;kanoume Reset thn mnhmh tou PIC
;o kwdikas ksekinaei apo thn dieu8unsh mnhmhs 0
;**************** diamorfwsh PIC *********************
BCF STATUS,RP1
BSF STATUS,RP0
clrf TRISC ;pou elegxei ton driver-translator
BCF STATUS,RP0
movlw b'11000000' ;energopoioume tis diakopes
movwf INTCON ;PANDA meta apo ka8e diamorgosh-teleutaia
;**************** kwdikas *********************
;**************** dinoume 12 bhmata 90 moires + kateu8unsh *********************
step
movlw .8 ;
movwf PORTC ;dinoume
NOP ;kateu8ynsh
NOP
NOP
movlw .40 ;me palmo 2 μsec
movwf PORTC ;sunexizoume na dinoume
NOP
NOP
NOP ;kateu8ynsh ---- kai bhma-step
movlw .32 ;gia ---- 2 μsec
movwf PORTC ;dinoume mono
NOP ;bhma-step 4 μsec gia na
CALL delay4 ;sumplhrwsoume thn 8etikh hmiperiodo (6μsec)
clrf PORTC ;kanoume
NOP ;thn arnitikh hmiperiodo
CALL delay4 ;4μsec
movlw .8 ;kai sta 2 teleutaia
movwf PORTC ;dinoume kateu8unsh
NOP
GOTO step ;gia 2 μsec
delay4
NOP
NOP
NOP ;xronoka8usterhsh
NOP ;2,4 μsec
return ;tc=0,4 μsec*6=2,4 μsec
eg
END