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.

CC2650 sensor controller queries

Hi,

We are working on cc26xx sensor tag. We are using BLE stack 2.1 sensortag application for our reference.

We need to integrate Sensor controller examples in the sensortag application. We are going to use 3 analog sensors with sensor controller interface. So we need to Sample each ADC value like different task.

We can see the some example in SCS like ADC data logger. But we don't know how to use scif driver for 2 or 3 tasks.

Can you please suggest how we can use SCIF driver for 2 or 3 individual tasks and integrate it with sensortag application?

Thanks,
Devang.

  • Hi Devang,

    Are the sample rate the same for all sensors? If so you could use the same single task and create 3 different arrays in the output structure.

    Regards,
    Svend
  • As Svend mentioned, you could sample 3 sensors with 1 task by making sequential measurements in the task such as the reference below from the help file:

    // Enable the ADC (fixed reference, 2.7 us sample time, manual trigger)
    adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);
    
    // For each pin (with one entry per pin in cfg.pAdcValue[] and output.pAdcValue[]) ...
    for (U16 n = 0; n < OUTPUT_SIZE; n++) {
        
        // Select ADC input
        adcSelectGpioInput(cfg.pAuxioASensorOutput[n]);
        
        // Sample the pin and store the ADC value
        adcGenManualTrigger();
        adcReadFifo(output.pAdcValue[n]);
    }
    
    // Disable the ADC
    adcDisable();

    Or you could set this up as three separate tasks like you mentioned. To set up a new task, select the project page in Sensor Controller Studio. At the bottom there is a task list with one task (assuming you are using ADC Data Logger example). Click Add new... and you will have a new task that will need to be configured basically the same as the original task but with a different ADC input pin. Note that with multiple tasks you will have to do extra work in your main code to start and stop the tasks.



    Either way you choose, in the sensor tag application you will have three output variables (or arrays) that will all be available from the scifTaskData.{task}.output array provided by the driver. The example for a single task will give you an array pAdcValue[] and in the case of multiple tasks you will have multiple task output structures to evaluate by task name.