cancel
Showing results for 
Search instead for 
Did you mean: 

AN2820 StepperMotor Example & Systick

bstumm
Associate II
Posted on February 09, 2011 at 19:55

AN2820 StepperMotor Example & Systick

1 REPLY 1
Posted on May 17, 2011 at 14:24

Ok, the Systick is use purely as a delay between the end of first acceleration DMA sequence, and the start of the second deceleration DMA sequence.

In your RTOS, or whatever, have the DMA interrupt start an RTOS Timer that initiates the second DMA transfer some time in the future.

Or with your RTOS's SysTick add the AN2820 code, instead of disabling the ticker, just count off ticks you want and then fire the DMA deceleration code once, and then wait until needed again.

Or use another STM32 TIM counter to provide the delay currently provided by SysTick.

That said, I don't see why you need to perform the Sustain phase in this manner, as there are probably more RTOS appropriate ways of doing this. For starters the DMA TC interrupt doesn't need to enable SysTick, and the SysTick doesn't need to start the second DMA sequence.

The DMA is simply being used to program in new values into TIM2 when it fires it's update ''interrupt''. You could build your own tables for this.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..