Skip to main content
OYoru.1
Associate II
February 12, 2023
Solved

How to make N pulses with One pulse mode, but pulse first delay after.

  • February 12, 2023
  • 2 replies
  • 2256 views

Hello i am trying to make N pulse in some exact time, when i adjust a timer with one pulse mode,

everything is ok but pulse always start with a delay because it is basically a pwm single starting with low side and high side. I want my pulse start immediately and after delay. Whatever i try i couldnt make it. (pwm modes, change channel polarity, idle state, counting up or down etc..)

Please somebody help me

Pulse timer output channel normally must be low state.

My signal looks like this, but if you look closely signal starts with a low delay and pulse after,

how to make it start with a pulse after delay?

0693W00000YAWl0QAH.bmp

This topic has been closed for replies.
Best answer by waclawek.jan

I don't quite understand what do you want to achieve, but one way how to reduce the "initial delay" is to set TIMx_CNT to TIMx_CCRx-1 before each start of the timer.

JW

2 replies

S.Ma
Principal
February 12, 2023

Not sure if it fits here, to generate a seriee of pulses of any timings, some STM32 have a DMA channel over timer channel, cycling over a table of toggle compares values.

waclawek.jan
waclawek.janBest answer
Super User
February 12, 2023

I don't quite understand what do you want to achieve, but one way how to reduce the "initial delay" is to set TIMx_CNT to TIMx_CCRx-1 before each start of the timer.

JW

OYoru.1
OYoru.1Author
Associate II
February 12, 2023

Thank you very much, that is simple and effective solution.