Can any body give me a good source code for controlling the 12 volt stepper motor speed .I am using Atmel's 89C52 controller.I am just using 4 pins of my port-1 to energize the motor's windings. this is the the code unit which i work for but its not wotking some how, ********************************************* int i,j; unsigned char STEP[4] = {0x0A,0x09,0x05,0x06}; //these r my switching sequence for my unipolar stepper motor// while(1) { for(i =0;i<4; i++) { P1 = STEP[i]; for(j=0;j<5;j++) { _nop_(); } } }
Hi, We use the 89c52 with stepper motors but they are connected via stepper driver ic's and allow us to have very precise control over them, but here is a link http://motion.sourceforge.net/tracking/ with a very simple inplementation that you may find useful (even some example code!). http://www.doc.ic.ac.uk/~ih/doc/stepper/control2/connect.html is also another example of a very similar solution using a darlington driver to drive the stepper as I feel that you have got to address this problem first, then as has aready been said you will need to start off with a long delay bewteen steps gradually reducing that time as the motor accelerates. Hope this Helps, Mark