Skip to main content
fshah48
Associate II
April 18, 2017
Question

TIM15 does not outpu pulses in OPM mode

  • April 18, 2017
  • 1 reply
  • 1500 views
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

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    April 18, 2017
    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 VenmoUp vote any posts that you find helpful, it shows what's working..
    fshah48
    fshah48Author
    Associate II
    April 18, 2017
    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>

    Tesla DeLorean
    Guru
    April 18, 2017
    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 VenmoUp vote any posts that you find helpful, it shows what's working..