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.

RTOS/CC3220MOD: PWM time constant too long

Part Number: CC3220MOD

Tool/software: TI-RTOS

Hi,

In my application I have to generate variable levels of voltages.

The custom-made board that I am working on has the "variable voltage output" routed to PWM5 on the CC3220MODSF, so I am using PWM for this.

Here is a sample of code that run inside a thread of TI-RTOS:

    PWM_Params pwmparams;
    PWM_Params_init(&pwmparams);
    pwmparams.dutyUnits = PWM_DUTY_US;
    pwmparams.dutyValue = 600;
    pwmparams.periodUnits = PWM_PERIOD_US;
    pwmparams.periodValue = 1000;
    pwm5_handle = PWM_open(Board_PWM5, &pwmparams);
    if (pwm5_handle == NULL) {
        UART_PRINT("Pwm Error\n");
    }

    for(;;) {
        PWM_start(pwm5_handle);
        usleep (1500000);
        /* Do task here */
        PWM_stop(pwm5_handle);
    }

The problem is with the instruction usleep (1500000) that I have to insert because whe I start PWM It takes more than one second to rise to about 3V.

In the picture you can find the waweform coming out from board pwm-out  (the smalleste one).

Is this a CC3220 PWM limit, is this due to a problem with the hardware project, or I am missing something in the code?

Thank you in advance

Damiano

  • Hi Damiano,

    Just to check, have you run the function to initialize the PWM module prior to the code you posted?

        /* Call driver init functions. */
        PWM_init();

    Can you try a different PWM signal (different pin) and see if you experience the same issue? Maybe there is a load on the line you are using that causes this delayed rise/fall time.

    Best,

    Kevin

  • Hi Damiano,

    Haven't heard from you in a little while and am going to assume you were able to solve your issue. If this is not the case, please post a response on this thread, or if the thread is locked, create a new thread.

    Thanks,
    Kevin
  • Yes kevin,

    Finally reviewing the circuti I've found that it's a mistake (by design?) of the Hw engineers who introduced a long time constant (about 1,6 sec.), maybe not considering that the PWM would be switched on/off during normal operations.

    Thank you.