cancel
Showing results for 
Search instead for 
Did you mean: 

PWM Generation CH1 CH1N doesnt work?

JBond.1
Senior

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?

2 REPLIES 2
KnarfB
Principal III

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

TDJ
Senior III

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.