Hi all,
I'm working on a project, in which I need some RF data transmission and highly accurate PWM signals for my application. We have a board with CC1310 SOC with PWM output on one of the connectors. Unfortunately, the accuracy of the PWM signal from CC1310 is not uniform for various duty cycles from 1% to 100%. I've tested with multiple CC1310 boards and all of them are showing random variations on each duty cycle from 1% to 100% (please check the log files). I think CC1310 should not be having such kind issues (I'm assuming CC1310 is generating a Hardware-PWM). Therefore, can anyone help me with understanding the CC1310's internal architecture and working?, so that I can resolve this issue as early as possible.
Questions:
1. Need confirmation on whether the CC1310 is generating hardware or software PWM?
2. What is the lowest resolution of the CC1310 PWM'signal I can get?
3. I'm taking the signal directly from CC1310's PWM pin, do I need to use any signal conditioning circuitry?
Code and other details:
Controller: CC1310F128RGZR.
Libraries: Non-RTOS.
PWM driver: Ti PWM driver.
PWM Configuration:
1. Time period 10ms.
2. PWM Duty unit is microsecond.
void PWM_Set_Init(void) { /* Initialize the PWM driver. */ PWM_init(); /* Initialize the PWM parameters */ PWM_Params_init(&pwmParams); pwmParams.idleLevel = PWM_IDLE_LOW; /* Output low when PWM is not running */ pwmParams.periodUnits = PWM_PERIOD_US; pwmParams.periodValue = 10000; pwmParams.dutyUnits = PWM_DUTY_US; pwmParams.dutyValue = 0;
/* Open the PWM instance */ pwm_Handler = PWM_open(Board_PWM1, &pwmParams); if (pwm_Handler == NULL) { //UART_write(uart,"\n\rPwmInitFail",13); while (1); } PWM_start(pwm_Handler); /* start PWM with 0% duty cycle */ }
/*PWM SET FUNCTION */ void fnPWM_Set(uint8_t ucPWMPercent, uint8_t ucType) { uint16_t ui16MappedPwmVal = 0; uint8_t ucCurrentDutyCycle = 0; if(PERMANENT_TYPE == ucType) { ucDuty_Cycle = ucPWMPercent; /* By this method the Lamp switches directly to the desired PWM value... */ if (ucPWMPercent == 0) { PWM_setDuty(pwm_Handler,0); } else if (ucPWMPercent % 2 != 0) { ui16MappedPwmVal = (ucPWMPercent * 100) - 30; /*subtracting by 30 as we're getting 0.3 difference in "ODD Duty-Cycle" */ PWM_setDuty(pwm_Handler,ui16MappedPwmVal); } else { ui16MappedPwmVal = ucPWMPercent * 100; PWM_setDuty(pwm_Handler,ui16MappedPwmVal); } }
/***************Different LAMP LOGS************************/
Ttotal.xlsx