2017-04-18 06:17 AM
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
2017-04-18 06:29 AM
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
2017-04-18 09:28 AM
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>
2017-04-18 09:59 AM
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
2017-04-18 10:01 AM
/* TIM15 clock enable */
RCC_APB1PeriphClockCmd(RCC_APB2Periph_TIM15, ENABLE); // APB1 != APB2 enable the clock on APB22017-04-18 10:15 PM
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>
2017-04-18 10:16 PM
Clive
sorry I addressed you as clive, apologies
fshah
On Tue, Apr 18, 2017 at 8:03 PM, Clive One <st-microelectronics@jiveon.com>
2017-04-19 12:07 AM
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>