cancel
Showing results for 
Search instead for 
Did you mean: 

Using TIM3_CH1 to generate a delayed one-shot pulse

darcy23
Associate II
Posted on July 30, 2013 at 07:48

Hi guys, it's been a few years since I've worked with the timers on these micro's and I've been rediscovering how much of a pain they can be.

Please refresh my memory so I at least know whether i'm wasting my time or not (trying to make this work)...

I'm trying to set up TIM3 to generate a one-shot pulse using CH1 output (full remap to PC6)

I have two options:

1.  A delayed single pulse on TIM3_CH1 triggered by software

2.  A delayed single pulse on TIM3_CH1 triggered by a rising edge on TIM2_CH2

Right now, I'd like to just get &sharp1 working...  Then I can work on &sharp2.  So, ignoring TIM2 completely for now...

Can I set up TIM3 CH1 in a one-pulse mode that I can then trigger by software 

(e.g. by setting an update flag etc)

?  Or, do I need to use another timer channel on TIM3 to stop CH1 once it's started?

In short, using a software trigger I'd like to have a delay of x ms, before a oneshot pulse y ms in duration.

All the examples I've seen seem to require an external trigger to kick off the oneshot slave timer channel.

Thanks all

#stm32-timer-one-shot-pulse
4 REPLIES 4
Posted on July 30, 2013 at 13:00

> All the examples I've seen seem to require an external trigger to kick off the oneshot slave timer channel.

Show us one of those examples, preferrably one which you already understand how it works. It will probably be quite simple to modify it to trigger it by software.

JW

darcy23
Associate II
Posted on July 30, 2013 at 21:52

Hi JW, at this point in time I'm pretty confident I can work it out myself, I just can't remember if what I'm trying to do is possible in the first place...  No point spending hours trying to do something that can't be done due to technical limitations  :)  By examples, I mean those with the peripheral library.

Posted on February 01, 2017 at 12:12

Hi

I also have the problem, I need to generate a single pulse triggered from software not an external trigger. I see some options how to do that but I am not sure about the best way. My ideal solution would be to use the 'one pulse mode' but how to trigger that from software?

Matthias

Posted on February 01, 2017 at 12:46

Simply set TIMx_CR1.CEN as you would if you would want to run the trigger continuously. The difference is in setting TIMx_CR1.OPM.

JW