2011-02-09 10:55 AM
AN2820 StepperMotor Example & Systick
2011-05-17 05:24 AM
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.