Skip to main content
Smalik
Associate III
Sep 25, 2022 7:30 PM UTC
Question

STM32WB55 - PWM not working

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

This topic has been closed for replies.

6 replies

Smalik
SmalikAuthor
Associate III
Oct 5, 2022 9:44 AM UTC

Hello,

I am waiting for the update.

Any help would be appreciable

.

Thanks and Regards

Sarthak Malik

Remy ISSALYS
ST Technical Moderator
Oct 7, 2022 2:49 PM UTC

Hello,

You can look this MOOC about PWM on STM32.

Best Regards

Smalik
SmalikAuthor
Associate III
Oct 11, 2022 6:21 AM UTC

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
SmalikAuthor
Associate III
Oct 20, 2022 6:02 AM UTC

Hello,

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

Thanks

Sarthak

Smalik
SmalikAuthor
Associate III
Oct 28, 2022 7:37 AM UTC

Hello @Remy ISSALYS​ 

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

Thanks

Sarthak

Smalik
SmalikAuthor
Associate III
Nov 3, 2022 5:51 AM UTC

Hello @Remy ISSALYS​ ,

Please update, I am waiting for the response.

Thanks

Sarthak