2025-06-27 6:53 PM - last edited on 2025-06-30 7:32 AM by Imen.D
2025-06-30 7:30 AM
Hello @xcm
Please try to write in English to make sure you can get an answer, because most of the people on this community can speak English but not Chinois.
If possible, to provide more details on your issue and share your code, TIM configuration, software version used.
Did you check the known HRTIM limitations in the STM32G471xx/473xx/474xx/483xx/484xx device errata - Errata sheet?
2025-07-02 5:23 AM
ok,
void HAL_HRTIM_RepetitionEventCallback(HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx)//20kHz中断
{
if (TimerIdx == HRTIM_TIMERINDEX_TIMER_A)
{
HAL_HRTIM_WaveformOutputStart(&hhrtim1,HRTIM_OUTPUT_TA1 | HRTIM_OUTPUT_TA2 | HRTIM_OUTPUT_TB1 | HRTIM_OUTPUT_TB2 | HRTIM_OUTPUT_TC1 | HRTIM_OUTPUT_TC2);
//HAL_HRTIM_WaveformOutputStart(&hhrtim1,HRTIM_OUTPUT_TB1 | HRTIM_OUTPUT_TB2);
hhrtim1.Instance->sTimerxRegs[0].CMP1xR = SPWM_400[i];
hhrtim1.Instance->sTimerxRegs[0].CMP3xR =SPWM_400[399-i];
hhrtim1.Instance->sTimerxRegs[1].CMP1xR = SPWM_400[i];
hhrtim1.Instance->sTimerxRegs[1].CMP3xR = SPWM_400[399-i];
}
}
The two PWM is not the same as the picture shows.how to solve it.every period has a wrong pwm(50Hz).