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.

CC3220MOD: CC3220 pwm with speech generation and Mono Class-AB Audio Amplifier. 1-2Hz noise problem

Part Number: CC3220MOD

Hi ;

I'm using now SimpleLink CC3220 SDK 2.30.00.05(17 Sep 2018)  

CCS v8.2.0 and FreeRTOS v10.0.0 Even when I produce a 1 kHz sinus, there is 1-2hz noise.

old versions did not have this noise 

SDK  1.60.00.04(01 Jan 2018)

CCS v7.2.0 and FreeRTOS v9.0.0

What could have changed. Is there anyone who can help

  • Hi; 

    I use the following code to understand the problem.

    Although PWM and timer frequencies are the same. I saw an oscilloscope phase shift.

    When I try the same code in the old sdk, the freaks are the same and there is no phase shift.

    I suspect that there is an error in driver codes. I recorded the oscilloscope signal on the camera.

    If you want to look at the link in the attachment

    void timerArrangePwmDuty(Timer_Handle myHandle1)
    {
    pwmFlag=1 ;
    GPIO_toggle(Board_BAT_CTRL);
    }

    void pwmtest(void){
    PWM_Handle pwm1 = NULL;
    PWM_Params params1;
    Timer_Handle timer0;
    Timer_Params params;

    PWM_init();
    PWM_Params_init(&params1);
    params1.idleLevel = PWM_IDLE_LOW;
    params1.dutyUnits = PWM_DUTY_COUNTS;
    params1.dutyValue = 1800 ;
    params1.periodUnits = PWM_PERIOD_US;
    params1.periodValue = 45;
    pwm1 = PWM_open(Board_PWM0, &params1);
    duty = 1800;
    PWM_setDuty(pwm1,duty);
    PWM_start(pwm1);

    Timer_init();
    Timer_Params_init(&params);
    params.period = 45;
    params.periodUnits = Timer_PERIOD_US;
    params.timerMode = Timer_CONTINUOUS_CALLBACK;
    params.timerCallback = timerArrangePwmDuty;
    timer0 = Timer_open(Board_TIMER1, &params);
    Timer_start(timer0) ;

    while(1)
    {
    if(pwmFlag){
    pwmFlag=0 ;
    }
    }
    }

  • Taylan,

    Can you attach the oscilloscope output image where you are seeing the phase shift? I don' think that would cause your noise issue. Do you have a spectrum analyzer to use so you can see the frequencies present in your signal? This way we can identify the 1-2 hz noise.

    Also, are you using a Launchpad? If flash the device and don't use your PC to power the device, does the noise go away?

    Regards,
    VR
  • Many thanks for your reply

    Hello again. My system was working properly with the old sdk. The sound is broken with the Sdk update.

    As a result of my tests, I saw that the pwm period was different with the timer period. Timer and PWM are both 45uSN.

    And I examined TI driver codes. I saw the difference below: Orange newgreen old driver code . PWMTimerCC32XX.c  
    And when I installed the old driver library, I found the error improved.
    My new question is how to fix and edit this change in new TI library. How can I compile.

    PWMTimerCC32XX.c  
    /*
    * ======== getPeriodCounts ========
    */
    static uint32_t getPeriodCounts(PWM_Period_Units periodUnits,
    uint32_t periodValue)
    {
    uint32_t period = 0;
    ClockP_FreqHz freq;

    ClockP_getCpuFreq(&freq);

    switch (periodUnits) {
    case PWM_PERIOD_COUNTS:
    period = periodValue;
    break;

    case PWM_PERIOD_HZ:
    if (periodValue && periodValue <= freq.lo) {
    period = (freq.lo / periodValue) - 1;
    }
    break;

    case PWM_PERIOD_US:
    period = (periodValue * (freq.lo/1000000)) - 1;====>period = periodValue * (freq.lo/1000000);
    break;

    default:
    /* Unsupported period units return an invalid period */
    period = PWM_INVALID_VALUE;
    }

    return (period);
    }