cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 Timer Reset on Capture

mscaff
Associate II
Posted on December 21, 2015 at 23:36

Hi,

I'm using STM32 micros for a while. Now I'm migrating and old firmware from a LPC17 cpu to a STM32F1 and I don't know if I can replicate one functionality.

I need to start a timer that will generate a single fixed width pulse via software control.

In LPC I can configure a timer to Stop and Reset the counter while clearing it's output on match, so all I need to start a new pulse as enable the timer and set the output pin manually.

So far I could only reproduce this behaviour in STM32 using interrupts to stop the timer. I've tried to use the OPM mode but it's triggering system seems to be from the input capture only.

I'm I missing something?

Thanks, Mauricio

 

#stm32-timer
1 REPLY 1
Posted on December 22, 2015 at 09:33

I don't think you need to deal with triggering. Read the TIMx_CCMRy.OCzM bitfield description to find out what does the output compare offer to you.

Btw., avoid TIM1/TIM8 if you can, otherwise dont' forget to set TIMx_BDTR.MOE.

JW