2023-02-11 06:32 AM
Hi, I have STM32F091RCTx and want to send PWM generated signals on 2 PIN's.
//...
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t*)LedData, LED_DATA_LENGTH);
//...
void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim)
{
if (htim == &htim1)
{
HAL_TIM_PWM_Stop_DMA(&htim1, TIM_CHANNEL_1);
}
}
I tried to setup "PWM Generation CH1 CH1N" and I would expect it to have same PWM signal generated on multiple PA7 and PA8 PIN's, but that does not seem to happen. Why? How to send same data on 2 PIN's?
2023-02-11 09:22 AM
There is a separate HAL_TIMEx_PWMN_Start_DMA function. And, at some point it might be easier to leave HAL behind and go to register level.
hth
KnarfB
2023-10-06 03:04 PM
The key thing is that timer with CH1N output needs to be started with HAL_TIMEx_PWMN_Start(), not HAL_TIME_PWM_Start(). I was not aware of it.