cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 n-Pulse Generation

Neo M
Associate II
Posted on January 11, 2017 at 15:21

I am trying to interface a Teknic Clearpath SDSK motor to STM32F7 Nucleo Dev Board. It is a Brushless DC motor with a stepper like interface. The motor moves a set distance based on the number of pulses it receives. The speed is determined by the frequency of the pulses, like a stepper motor. What is the best way to generate a fixed number of pulses reliably from STM32 F7?

One of the solutions that I came across is to feed a PWM out back in to a timer in counter mode, and stop the PWM out when the required number of pulses have been generated. Is there a novel way of doing this without the need of feedback and ISRs?

https://community.st.com/tags♯/?tags=stm32%20pwm%20timers

‌ 

https://community.st.com/tags♯/?tags=n-pulse

‌

#stm32-pwm-timers #n-pulse #reset-stm32
6 REPLIES 6
Posted on January 11, 2017 at 16:20

TIM1/TIM8 have a repetition counter TIMx_RCR, which together with one-pulse mode can be used for generating a given number of pulses (and in F7 it's 16-bit, in contrast to F4 where it was 8 bit only).

JW

S.Ma
Principal
Posted on January 11, 2017 at 18:05

if the pulses in the future need to be dynamically modulated (duty cycle), DMA buffer feeding a Timer output compare could also be an alternative solution.

Posted on January 11, 2017 at 17:06

+1 One-Shot w/Repetition

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on January 12, 2017 at 17:31

Keeping track of what you're doing would certainly negate the need to count it externally. The size of the pattern buffer, and use of HT/TC interrupts on the DMA could decimate the interrupt loading.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on November 14, 2017 at 03:28

Hi,how can I generate an interrupt when the given numbers of pulses is stopped?(I use TIM1 on stm32f427)

Posted on November 14, 2017 at 09:16

The Update Event (thus the interrupt resulting from it, if enabled) happens only after the number of cycles given by Repetition Counter elapsed.

JW