Skip to main content
Neo M
Associate III
January 11, 2017
Question

STM32 n-Pulse Generation

  • January 11, 2017
  • 3 replies
  • 4071 views
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
This topic has been closed for replies.

3 replies

waclawek.jan
Super User
January 11, 2017
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

Tesla DeLorean
Guru
January 11, 2017
Posted on January 11, 2017 at 17:06

+1 One-Shot w/Repetition

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
S.Ma
Principal
January 11, 2017
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.

Tesla DeLorean
Guru
January 12, 2017
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 VenmoUp vote any posts that you find helpful, it shows what's working..
waclawek.jan
Super User
November 14, 2017
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