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.

CC2652RB: How to change the ADC module's "Sampling Duration" dynamically

Part Number: CC2652RB
Other Parts Discussed in Thread: SYSCONFIG, SIMPLELINK-CC13XX-CC26XX-SDK

Hi Ti,

As the title said, I want to change the Sampling Duration dynamically in my program, How to do it? 

  • Hi junde,

    Changing the ADC sampling duration during run-time is not made intuitive by the SIMPLELINK-CC13XX-CC26XX-SDK.  You would need to copy the ADC code from ti_drivers_config.c/h to your main application, disable ADC from being generated by SysConfig, change the adcCC26xxHWAttrs and ADC_config to variables instead of constants in order to be capable of modifying the samplingDuration, and close then open the ADC driver each time so that the handle is updated correctly.  A more optimal solution to consider is using the Sensor Controller to control your ADC operation, as it can more easily modify the sampling during during execution.

    Regards,
    Ryan