Electronic Components Datasheet Search
  English  ▼

X  

AN1495 Datasheet(PDF) 21 Page - STMicroelectronics

Part # AN1495
Description  Microstepping stepper motor drive
PDF  25 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

AN1495 Datasheet(HTML) 21 Page - STMicroelectronics

Back Button AN1495 Datasheet HTML 17Page - STMicroelectronics AN1495 Datasheet HTML 18Page - STMicroelectronics AN1495 Datasheet HTML 19Page - STMicroelectronics AN1495 Datasheet HTML 20Page - STMicroelectronics AN1495 Datasheet HTML 21Page - STMicroelectronics AN1495 Datasheet HTML 22Page - STMicroelectronics AN1495 Datasheet HTML 23Page - STMicroelectronics AN1495 Datasheet HTML 24Page - STMicroelectronics AN1495 Datasheet HTML 25Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 21 / 25 page
background image
AN1495
Code
Doc ID 8700 Rev 3
21/25
Appendix B
Code
The following is an except from the firmware which executes on the ST7264 based control
which is part of the PractiSPIN™ evaluation system. This code segment is executed when
the decision has been made that it is time for the L6208 to take the next microstep (either
forward or reverse).
; PB.4 is the L6208 clock pin
; PB.5 is the L6208 reset pin
; stepstate is a byte variable which controls the motor stepping.
; torquscaler is a byte used to modulate the normalized sine wave values
read from the table to set the current level
; TAOC1LR is a register that controls Vrefa (via the duty cycle into the low
pass filter)
; TBOC1LR is a register that controls Vrefb (via the duty cycle into the low
pass filter)
bres PBDR,#4
;take clock back low ready to generate rising edge later
bset PBDR,#5
;normal state for reset jumpifflagclear forward,
doclockrev; jump if direction is reverse
;direction is forward
inc stepstate
jrne for002
; skip if stepstate has not rolled over to zero
bres PBDR,#5
; activate reset to maintain sync (just for added noise
immunity insurance)
for002:
ld a,stepstate
and a, #%00011111 ; use only lower five bits as index for table lookup
ld x,a
; save index
; on indexes 8 and 9, clock L6208 to sequence through zero and then polarity
reversal and a, #%00001110
cp a, #8
; 8 or 9
jrne for001
bset PBDR,#4
; rising edge for clock
for001:
ld a, (microtable1,x); get normalized value from table
ld y, torquescaler
mul y,a
; y:a = (table value) * torquescaler
ld TAOC1LR,y
; duty cycle = (table value) * torquescaler/256
; repeat for phase B



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com