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.

TMS320F280021: Improve/Avoid PWM Jitter

Part Number: TMS320F280021

Hello,

I have an issue with the generated PWMs waveforms, they are correct from duty cycle and applied deadtime perspective but the waveform are not stable, it is moving right and left (Jittering) on the scope
I have made sure it is not a triggering issue in my scope so I am sure it is a SW issue but I do not have a clue what cause this issue

PS. I am using global loading and tried also to change the PWM switching frequency but still got the same behavior 

Do you have suggestions to solve this issue?

Thanks in advance

  • Hi Mohamed,

    Please share a snip shot of the jitter you are seeing through scope. 

    Also, Can you provide, whhat is the swithcing freq, CMPA values you used to comment more.

    Best,

    Uttam

  • Hi Uttam,

    The set switching frequency is 100KHz and CMPA values is 250
    I have just measured the switching frequency on the scope, and it is fluctuating around 101.04 KHz and I think this is the reason I might have this Jitter

    PS. I am not using the evalboard so basically, I am using the evalboard just for flashing/debugging the external target on the board accordingly I am using crystal oscillator for my input clock frequency


    And the way I configured the external clock is as below

    Could you please guide me if I am configuring the external clock correctly? I have also attached a screenshot of the used 20MHz external crystal (I have measured its crystal and it is correct >> 20MHz)  

    //
    // To use INTOSC as the clock source, comment the #define USE_PLL_SRC_XTAL,
    // and uncomment the #define USE_PLL_SRC_INTOSC
    //
    //#define USE_PLL_SRC_XTAL
    #define USE_PLL_SRC_INTOSC

    //
    // 20MHz XTAL on controlCARD. For use with SysCtl_getClock().
    // 10MHz INTOSC on the device.
    //
    #define DEVICE_OSCSRC_FREQ 20000000U
    #define DEVICE_INTOSC_FREQ 10000000U

    #if defined(USE_PLL_SRC_XTAL)
    //
    // Define to pass to SysCtl_setClock(). Will configure the clock as follows:
    // PLLSYSCLK = 10MHz (INTOSC2) * 60 (IMULT) / (2 (REFDIV) * 3 (ODIV) * 1(SYSDIV))
    //
    #define DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_OSC2 | SYSCTL_IMULT(60) | \
    SYSCTL_REFDIV(2) | SYSCTL_ODIV(3) | \
    SYSCTL_SYSDIV(1) | SYSCTL_PLL_ENABLE | \
    SYSCTL_DCC_BASE_0)

    //
    // 100MHz SYSCLK frequency based on the above DEVICE_SETCLOCK_CFG. Update the
    // code below if a different clock configuration is used!
    //
    #define DEVICE_SYSCLK_FREQ ((SYSCTL_OSCSRC_OSC2 * 60) / (2 * 3 * 1))

    #elif defined(USE_PLL_SRC_INTOSC)
    //
    // Define to pass to SysCtl_setClock(). Will configure the clock as follows:
    // PLLSYSCLK = 10MHz (INT_OSC2) * 30 (IMULT) / (1 (REFDIV) * 3 (ODIV) * 1(SYSDIV))
    //
    #define DEVICE_SETCLOCK_CFG (SYSCTL_OSCSRC_OSC2 | SYSCTL_IMULT(30) | \
    SYSCTL_REFDIV(1) | SYSCTL_ODIV(3) | \
    SYSCTL_SYSDIV(1) | SYSCTL_PLL_ENABLE | \
    SYSCTL_DCC_BASE_0)

    //
    // 100MHz SYSCLK frequency based on the above DEVICE_SETCLOCK_CFG. Update the
    // code below if a different clock configuration is used!
    //
    #define DEVICE_SYSCLK_FREQ ((DEVICE_INTOSC_FREQ * 30) / (1 * 3 * 1))
    #endif

    //
    // 25MHz LSPCLK frequency based on the above DEVICE_SYSCLK_FREQ and a default
    // low speed peripheral clock divider of 4. Update the code below if a
    // different LSPCLK divider is used!
    //
    #define DEVICE_LSPCLK_FREQ (DEVICE_SYSCLK_FREQ / 4)

  • I see that the mis-configuration was done for clock.

    In the code you are using Internal CLK instead of XTAL. Please correct this, as of my understanding you want to use XTAL.

    // To use INTOSC as the clock source, comment the #define USE_PLL_SRC_XTAL,
    // and uncomment the #define USE_PLL_SRC_INTOSC
    //
    //#define USE_PLL_SRC_XTAL
    #define USE_PLL_SRC_INTOSC

    2. Let me know if you are still seeing the PWM jitter? Can you share the snipshot of the setup how you are measuring the PWM waveforms, this generally happens with wrong measurements. 

  • The jitter is fixed. I was setting the clock wrongly
    Thanks for your reply