cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 - PWM not working

Smalik
Associate II

Hello,

I am trying to use PWM using DMA in the P-NUCLEO WB55 dongle but the PWM signal was not behaving according to the setting which was done in STM32Cube MX.

Can anyone help me to understand the role of Auto Reload Register, Repetition counter, and PWM Generation channel pulse? Basically, I want to generate 24 pulses with different pulse widths but when I am trying to generate 24 pulses I am always getting 3 extra pulses.

Code -

for (int i=23; i>=0; i--)
	{
		if (color&(1<<i))
		{
			pwmData[i] = 66;
		}
		else pwmData[i] = 33;
	}
 
HAL_TIM_PWM_Start_DMA(&htim1, TIM_CHANNEL_1, (uint32_t *)pwmData, 24);

So my question is why I am always getting 3 extra pulses every time. The parameters that are defined in cube Mx are given below-

System Clock - 64 MHz

TImer counter Prescaler- 0

Counter period- 100-1

Repetition counter- 24

Firmware version - STM32Cube FW_WB V1.14.0

I have also tried to find some documents on the PWM but I am not able to find any relevant document, Please help me to provide any document on PWM.

Any help would be appreciable

.

Thanks and Regards

Sarthak Malik

6 REPLIES 6
Smalik
Associate II

Hello,

I am waiting for the update.

Any help would be appreciable

.

Thanks and Regards

Sarthak Malik

Remy ISSALYS
ST Employee

Hello,

You can look this MOOC about PWM on STM32.

Best Regards

Smalik
Associate II

I have already seen this video. I know how the PWM works but my question is when I am configuring the PWM to generate 24 pulses I am getting 3 extra pulses. So why am I getting 3 extra pulses?

Thanks

Sarthak

Smalik
Associate II

Hello,

I am waiting for your response please provide me a solution.

Thanks

Sarthak

Smalik
Associate II

Hello @Remy ISSALYS​ 

I am waiting for your response. Any help would be appreciable.

Thanks

Sarthak

Smalik
Associate II

Hello @Remy ISSALYS​ ,

Please update, I am waiting for the response.

Thanks

Sarthak