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.

SENSOR-CONTROLLER-STUDIO: Problem about using DP0 analog pin on CC2650STK

Part Number: SENSOR-CONTROLLER-STUDIO
Other Parts Discussed in Thread: CC2650STK

Hi,

I try to use cc2650stk sensortag with cc debugger devpack to sample a square wave signal that around 30kHz. Currently, I use sensor controller studio for testing codes, which is shown below,

// Select ADC input

adcSelectGpioInput(AUXIO_A_SENSOR_OUTPUT);

// Schedule the first execution

fwScheduleTask(1);

// Enable the ADC (fixed reference, 2.7 us sample time, manual trigger)

adcEnableSync(ADC_REF_VDDS_REL, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);

// Sample the sensor and store the ADC value

adcGenManualTrigger();

adcReadFifo(output.adcValue);

// Disable the ADC

adcDisable();

// Schedule the next execution

fwScheduleTask(1);

Then, I use the Task Testing module in Sensor Controller studio to monitoring "output.adcValue" and export about  the 1000 output variables by using  "save post-iteration vectors".

However, when I do FFT in Matlab for the exported data, the results do not show any main frequency components. Is it because the task testing will affect the sampling period of ADC (display the output.adcValue first, then doing sampling)?

  • Hi Boyuan,

    Task testing operates at a much lower iteration interval than what is necessary for you to measure a 30 KHz signal. You can, however, use Run-Time Logging to achieve a much faster iteration interval, and subsequently a much faster sampling.

    Enable Run-Time Logging in your Task's resource page, and in your Execution Code add the following line of code at the end,

    rtlLogStructs(BV_RTL_LOG_OUTPUT);

    Go to the Run-Time Logging view beneath Task Testing, make sure "Log output?" is checked, set the RTC tick interval to a fast enough interval, and start the task as usual. You should observe much more data come through, which can be saved just as in Task Testing with the "save post-iteration vectors".

  • Hi Edvard,

    Thanks for reply, I reduce the RTC tick interval from 0x00002000 to 0x00000004 and the iteration interval is faster than before. But I still have some questions. What is the unit of the RTC tick interval? Because I want to the time interval between the each sample? Or, how can I determine the sampling frequency precisely in sensor controller?