How to configure TIM1 PWM for repetition mode
Im using a STM32F030C8T6 with PWM output to generate a sound output. I would like to use the repetition mode of the TIM1 so it will output the same PWM period 6 times.
If I configure the timer and use both HAL_TIM_Base_Start_IT() and HAL_TIM_PeriodElapsedCallback(), I do get a interrupt after 6 repeats. ...... But the PWM output is not switching.
Alternatively I can configure the system for HAL_TIM_PWM_Start() and HAL_TIM_PWM_PulseFinishedCallback() and the PWM output generates a waveform BUT I get an interrupt every cycle (not every 6th).
Everything I have seen online seems to suggest that it should easily be able to generate several pulses and then interrupt once done.
My thoughts are that this might be related to the output pin of the PWM not being initialized properly, but I'm open to any thoughts.