cancel
Showing results for 
Search instead for 
Did you mean: 

TIM15 does not outpu pulses in OPM mode

fshah48
Associate II
Posted on April 18, 2017 at 15:17

I tried STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\TIM\OnePulse examples after adding systick timer to generate 50Hz square wave looped back to timer input. This was easiest way to test it. It worked fine. Now I changed timer to TIM15 and made corresponding changes to turn on its clock and configuring appropriate GPIO pins. It does no work. I have spend hours on it back and forth between TIM4 and TIM15. Former works but later does not.

I also have another question: why does BothEdge does no work in input capture mode, what do I need to do to make it work.

PS I am using STM32Discovery board

7 REPLIES 7
Posted on April 18, 2017 at 15:29

Different timer have different features, from Advanced to Basic, you'd need to review the Reference Manuals to determine if you are trying to use features a specific timer lacks.

Where both edges don't work you can pair CH1/2 or CH3/4 to capture opposing edges of the same input. ie TI1/2 routing

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

Clive

I am using OPM o generate pulses in both cases. Both TIM4 and TIM15 support

this feature in exactly same manner. I have attached the code for your

perusal. Please help me.

As far using two pairs of same timer for OPM generation I am not sure if it

will work. I am not sure how to do input trigger selection and slave mode

selection for two channel pairs of the same time.

Do you mind to provide the code snippet that works in this regard.

fshah

On Tue, Apr 18, 2017 at 6:30 PM, Clive One <st-microelectronics@jiveon.com>

Posted on April 18, 2017 at 16:59

Your second question asked about input capture only, not multichannel OPM

TIM_ICInitStructure.TIM_Channel = TIM_Channel_1;

TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Rising;

TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_DirectTI;

TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1;

TIM_ICInitStructure.TIM_ICFilter = 0x0;

TIM_ICInit(TIM3, &TIM_ICInitStructure);

TIM_ICInitStructure.TIM_Channel = TIM_Channel_2;

TIM_ICInitStructure.TIM_ICPolarity = TIM_ICPolarity_Falling;

TIM_ICInitStructure.TIM_ICSelection = TIM_ICSelection_IndirectTI; // Uses CH1 input

TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV1;

TIM_ICInitStructure.TIM_ICFilter = 0x0;

TIM_ICInit(TIM3, &TIM_ICInitStructure);

Will have to look at the TIM15, you have the VL-Discovery with the F100 part? You know that has a very limited subset of functions, ie 'Value Line' low cost, low function

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

/* TIM15 clock enable */

RCC_APB1PeriphClockCmd(RCC_APB2Periph_TIM15, ENABLE); // APB1 != APB2 enable the clock on APB2
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on April 19, 2017 at 05:15

Steve

Thank you for pointing mistake in setting TIM15 clock. It helped to coax

output, but no pulse. It just goes high and stays high.

I apologize not o make myself very clear. I want to generate OPM on each

edge. TIM2-TIM5 do not have bothEdge mode, but TIM15 is purported o have

it, that is why I waned to give it a try.

please help

kind regards

fshah

On Tue, Apr 18, 2017 at 8:02 PM, Clive One <st-microelectronics@jiveon.com>

Posted on April 19, 2017 at 05:16

Clive

sorry I addressed you as clive, apologies

fshah

On Tue, Apr 18, 2017 at 8:03 PM, Clive One <st-microelectronics@jiveon.com>

Posted on April 19, 2017 at 07:07

Clive

Thank you for pointing mistake in setting TIM15 clock. It helped to coax

output, but no pulse. It just goes high and stays high at other times

momentary high decaying to zero.

I apologize not to make myself very clear. I want to generate OPM on each

edge. TIM2-TIM5 do not have bothEdge mode, and I wanted o give TIM15 a try

please help

kind regards

fshah

On Tue, Apr 18, 2017 at 8:03 PM, Clive One <st-microelectronics@jiveon.com>