cancel
Showing results for 
Search instead for 
Did you mean: 

STM32GO controller PWM Generation issue

Denial1
Associate II
Hello All
Current Device setup:-
NUCLEO-G071RB Eval board
STM32CubeMX settings please find the attached screenshots.
  • I'm trying to generate PWM signal using [ TIM3 channel 3] in NUCLEO-G071RB Eval board.
  • Time period is 28 microseconds and width are 3 microseconds.
  • As you can see in the below [image 1 ]only the first pulse is different or corrupted, which gives 32 microseconds time period and width are 7 microseconds .
  • From the second pulse , we are able to get the expected pulse as shown below [image 2] Time period is 28 microseconds and width are 3 microseconds.
  • Same behaviour is observed in STM32Cube_FW_G0_V1.6.0 package code, given by STM32 Timer PWM output example code.
Please provide the solution to resolve this issue.
 
Image 1:-
Denial1_0-1697024584663.png
 
Image 2:-
Denial1_1-1697024584665.png

 

10 REPLIES 10
Sarra.S
ST Employee

Hello @waclawek.jan@Denial1@TDK

This behavior is now noted in Readme files of all HAL TIM examples calling HAL_TIM_PWM_ConfigChannel() with the output channel configured in PWM1 mode:

TIM_6Steps, 

TIM_Asymetric, 

TIM_CascadeSynchro,

TIM_Combined,

TIM_ComplementarySignals,

TIM_Dithering,

TIM_DMA,

TIM_DMABurst,

TIM_ParallelSynchro,

TIM_PrescalerSelection,

TIM_PWMOutput.

The note is the following: 

In this examples, the output channel is configured in PWM1 mode meaning that in up-counting mode, channel 1 is active as long as TIMx_CNT < TIMx_CCR1. As, in the function HAL_TIM_PWM_Start* function, the output channel is enabled prior enabling the timer's counter a timing difference might be observed on the first generated PWM. This difference corresponds to the delay - in term of number of CPU cycles - between the channel enable and the counter enable in the HAL_TIM_PWM_Start* function.

Thank you! 

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.