??? 01/02/08 19:54 Read: times |
#148940 - How to program a stepper driver Responding to: ???'s previous message |
Without knowing anything about '51 ASSY I can tell that the above program is far too complex for such a small task as driving a stepper motor.
The problem is really simple. All You need is a counter and then a routine that converts this counter into motor pin drives. The stepper needs the 2 or 3 lowest bits of this counter depending if You are going to use half steps or not. The subroutine that does the conversion is just an if-then-else or case( n) .... construct with 4 or 8 branches. You just simply compare the lowest bits with constants and then branch to corresponding output pin setup. Make a truth table so this is easy to code. Now, increment the counter then call the converion and the motor will step once to some direction. Decrement the counter and call the converter and motor steps the other direction. Add timer and the switch handling and there You are. |
Topic | Author | Date |
8052 help w/ my code please | 01/01/70 00:00 | |
How to program a stepper driver | 01/01/70 00:00 | |
Delay | 01/01/70 00:00 | |
this makes absolutely no sense | 01/01/70 00:00 | |
tried commenting delay | 01/01/70 00:00 | |
no offense, but THINK | 01/01/70 00:00 | |
ah | 01/01/70 00:00 | |
yes | 01/01/70 00:00 | |
What is oscillator speed? | 01/01/70 00:00 | |
osc speed | 01/01/70 00:00 | |
MEGAHENRY? | 01/01/70 00:00 | |
oops | 01/01/70 00:00 | |
Try this | 01/01/70 00:00 | |
Not the cure | 01/01/70 00:00 | |
SWITCHES | 01/01/70 00:00 | |
Was that YOUR simulator, Jon? :-) | 01/01/70 00:00 | |
Pinnacle52 | 01/01/70 00:00 | |
Found it | 01/01/70 00:00 | |
Almost there | 01/01/70 00:00 | |
any LEDs? | 01/01/70 00:00 | |
no led's | 01/01/70 00:00 | |
then use the scope as a LED... :-) | 01/01/70 00:00 | |
but not THIS nonsense! | 01/01/70 00:00 | |
good idea | 01/01/70 00:00 | |
Try it now. | 01/01/70 00:00 | |
I think, Steve meant, he will try to use the scope | 01/01/70 00:00 | |
Oh..OK | 01/01/70 00:00 | |
It works![]() | 01/01/70 00:00 |