Source Code
Click to Download
Motor.c
David AustinPosted: 11/1/2010
Rating: *****
Size: 2.89 KB
Code from "Generate stepper-motor speed profiles in real time" (David Austin, Embedded Systems Programming magazine, January 2005). The article can be found at http://www.eetimes.com/design/embedded/4006438/Generate-stepper-motor-speed-profiles-in-real-time
Rate this Content
Navigate to related information



lllll5
1/25/2011 9:46 PM EST
thanks ,I am using the stm32f103 , controlling the step motor
Sign in to Reply
njsoffice
1/28/2011 8:59 AM EST
Hi,
I`d like to know if you can implement the code onto
14 pin PIC like 16F684,16FC505 / AVR ATTiny84, with coils/outputs on pin5/output-coilD, pin6/output-coilC, pin7/output-coilB, pin8/output-coilA
(other parameters, Mode1 on pin2, Mode2 on pin3, pin4 NC, pin9 LED, pin10 LED, pin11 step, pin12 dir, pin13 enable.
Pin9
This diagnostic output tracks the ENABLE signal. If this signal remains HI, it’s an indication that the ENABLE signal is not being received. When this signals is HI, all outputs are LO and no stepping occurs. The LED connected to this output will show when the motors are being energized.
Pin10
This signal goes HI during step 1 of the stepping pattern and returns LO thereafter. (In halfstep mode the signal remains HI for step 2 also.) It is used as a ‘sync’ signal indicating step 1 of the pattern, as a visual indicator of stepping. The LED connected to this output will appear to flash at ¼ the stepping rate. Note that if stepping happens to stop at step 1 of the pattern this signal will remain HI.
MODE 1, MODE 2
These two inputs specify the stepping pattern: Wave Drive, High Torque, Half Step.
[1=1,2=0] Wave Drive (Single coil, 4-step pattern)
[1=1,2=1] High Torque (Double coil, 4-step pattern)
[1=0,2=1] Half-Step (Mixed, 8-step pattern)
[1=0,2=0] Reserved.
If left unconnected, these inputs float high and the mode is High Torque)
what modification to the code, to register pins as listed would need to be made.
Sign in to Reply
Umamahesha
2/19/2011 1:09 AM EST
Thanks for sharing.
Sign in to Reply
mselman
3/24/2012 2:33 AM EDT
thanks for you
Sign in to Reply
Mike_Sokolowski
5/15/2012 7:32 AM EDT
Thank you for sharing the knowledge and code.
Sign in to Reply