This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280049C: The frequency of HRPWM is jittered.

Part Number: TMS320F280049C

Dear team:

When my customer was testing HRPWM, he found that the period of PWM would have a jitter of 2*TBCLK.

That is, a frequency jitter of 8Hz appears at a frequency of 20KHz, which is shown in the red part of the waveform in the figure below.

The following is his code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
uint16_t period;
period = DEVICE_SYSCLK_FREQ / frq;
// Enable ePWMx clock
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_EPWM1);
// Enable HRPWM clock
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_HRPWM);
// Disable sync(Freeze clock to PWM as well)
SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
// Set AQ
HRPWM_setActionQualifierAction(PSFB_X_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
HRPWM_setActionQualifierAction(PSFB_X_BASE, EPWM_AQ_OUTPUT_A, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
HRPWM_setActionQualifierAction(PSFB_X_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_LOW, EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
HRPWM_setActionQualifierAction(PSFB_X_BASE, EPWM_AQ_OUTPUT_B, EPWM_AQ_OUTPUT_HIGH, EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
// Set up TBPRD
EPWM_setTimeBasePeriod(PSFB_X_BASE, period - 1);
EPWM_setTimeBaseCounter(PSFB_X_BASE, 0U);
EPWM_setClockPrescaler(PSFB_X_BASE, EPWM_CLOCK_DIVIDER_1, EPWM_HSCLOCK_DIVIDER_1);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Is there a problem with the program?

Best regards