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