2023-09-08 05:34 AM - edited 2023-09-08 07:34 AM
Hi.
I am trying to configure a timer with PWM in one-pulse mode (TIM5) as slave of another timer that sends N pluses to trigger TIM5.
I am unable to do it could you give me a hand to understand what I am doing wrong?
TIM1 when started should triggers an specified amount of pulses. I thought I could use Repetition Counter but for now I am not getting any pulses.
I am using a STM32G474RE MCU.
To start the timers I use:
HAL_TIM_PWM_Start(&htim5, TIM_CHANNEL_4);
HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_5);
Thanks in advance,
Raúl Pérez Gómez
2023-09-08 05:36 AM - edited 2023-09-08 05:40 AM
2023-09-08 07:34 AM
Just edited the post to add the MCU.
I am using a STM32G474RE MCU.
Thanks for the help.
2023-09-08 07:40 AM - edited 2023-09-08 07:41 AM
Oh yes I watched that video to start. But I cannot get it to work. And he is using the trigger on the TM1. I don't have a pin to trigger the timer. I though that would be enough to call HAL_TIM_Start function, or am I wrong? Maybe I am missing something I have to set before I call the start function? I would like to set the number of pulses TIM1 should trigger and then start it until it stops.
2023-09-08 07:43 AM
2023-09-08 07:55 AM
I see I am making a mistake... I should use HAL_TIM_OnePulse_Start instead of HAL_TIM_PWM_Start.
Let me try ...