AnsweredAssumed Answered

Best method for generating stepper motor clock

Question asked by Phillip Roth on Aug 6, 2018
Latest reply on Aug 13, 2018 by Phillip Roth

It's a simple thing I've done on other processor families but seems there are are many ways to generate a simple stepper motor clock to control accell/cruise and decell on the 52259. This is just a simple stepper clock and not phase control but don't want to hack something in when there's a simple way to do it.


Accell and decell profiles are fixed so ideally I'd generate a table of timer values, interrupt on each clock output to track position, then output the next timer value to accell or decell or just let the output run to maintain cruise, kinda stepper motor control 101.


Thought PWM would be the best but now thinking about using a timer output and interrupting on falling edge to have ample time to load a new value for the next leading edge but it's not double buffered and I'd have to subtract the current value from the target value to avoid clock jitter caused by ISR latency, etc..etc..etc.which sounds like a mess.


Pretty sure this has been done at least a few hundred times before and just want to leverage some knowledge, possibly some code