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.

LAUNCHXL-CC26X2R1: Unable to get Output of ADC DATA Streamer example in Sensor Controller

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SENSOR-CONTROLLER-STUDIO, SIMPLELINK-CC13XX-CC26XX-SDK

Hi,

I am facing problem in getting the output for the ADC DATA Streamer example of the Sensor Controller Studio. Below I am attaching the Screenshot of my output after connecting to the Launchpad.

Can anyone please help, to solve this problem?.

Thank you.

  • Hi Poojan,

    Your screenshot is too small to determine where your code is stuck.  What SENSOR-CONTROLLER-STUDIO version are you using and which SIMPLELINK-CC13XX-CC26XX-SDK version is it referencing?  Have you selected the CC2652R1F as your device when importing the project and do you run the initialization code before starting execution code?  Please refer to the Sensor Controller Studio User's Guide and SimpleLink Academy Labs as well.

    Regards,
    Ryan

  • Hi Ryan,

    Thank you for the response.

    Currently, I am using SENSOR CONTROLLER version 2.8.0.170.

    Actually, my task is, I am generating PWM signal in main processor and giving this as an input to the sensor controller anlog pin, and the task of sensor controller is to perform ADC and generate interrupt to the main processor when it is below the threshold.

    So, now problem is PWM is genertaed at very fast rate, so Sensor controller needs to convert adc value continously and send the interrupt to main processor very fast, for that I tried refering to ADC DATA streamer example in SENSOR CONTROLLER studio and I tried modifying it according to my requirment. Following is my code in Sensor Controller Studio.

    Initialization Code:

    // Select ADC input

    adcSelectGpioInput(AUXIO_A_ADC_INPUT);

    Execution code:

    // Enable the ADC

    adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);

    while (state.exit == 0){

    // Sample the analog sensor

    adcGenManualTrigger();

    adcReadFifo(output.adcValue);

    U16 oldState = state.High;

    if (output.adcValue > cfg.Threshold) {

    state.High = 1; // High input - > High state

    gpioClearOutput(AUXIO_O_GREEN_LED);

    } else {

    state.High = 0; // Low input -> Low state

    gpioSetOutput(AUXIO_O_GREEN_LED);

    }

    // If ALERT interrupt generation is enabled

    if (state.alertEnabled == 1) {

    if (oldState == state.High) {

    // Signal the application processor.

    fwGenAlertInterrupt();

    // Disable further generation to avoid unnecessary interrupts. It will be reenabled

    // by the application after handling the ALERT interrupt.

    state.alertEnabled = 0;

    }

    }

    }

    // flush the ADC FIFO

    adcFlushFifo();

    // Disable the ADC

    adcDisable();

    Regards,

    Poojan

  • Based on the nature of the ADC Data Streamer example, I can confirm that this is expected behavior.  You are encountering the "Task execution timed out" error since the execution code will forever loop the state.exit condition while not communicating with an application.  This "stuck" state is detected by the Sensor Controller Studio's Task Debugger and thus it will automatically stop regardless of the ADC trigger source.  You could remove the while loop but then the RTC would have to trigger each iteration of the Execution Code, which will ultimately result in slower ADC readings.  This behavior will be undetected when running in Code Composer Studio with the System CPU application waking on ALERT interrupt, setting state.exit, and processing the available samples.  If your application should only monitor whether ADC values are below a threshold, not the number of ADC samples themselves, then I recommend evaluating the ADC Window Monitor example instead.

    Regards,
    Ryan

  • Thank you for the help Ryan.

    Regards,

    Poojan

  • Hi Ryan,

    I need one help.

    I am running only ADC DATA Streamer example in sensor controller studio, with their example code, then also it is showing the same the Task debugging error. 

    So, i want to known, if I want to test that example, How to test it? Can you please help me in that.

    Regards,

    Poojan

  • I've already explained that this is expected based on the while loop behavior of the example.  You need to generate the sensor controller driver source code and import the SCS project into Code Composer Studio.  There are instructions in Tasks 1 and 2 of the Sensor Controller Fundamentals SLA, and other details are also provided in the SCS User's Guide (both linked in a prior response).

    Regards,
    Ryan