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.

RTOS/CC1310: SCS ADC issues

Part Number: CC1310

Tool/software: TI-RTOS

Hi,

1.  I am using node and concentrator code, with a temperature sensor connected to the node side. The temperature resolution is 0.1C. 

The setup is as follows:

The node senses the temperature and sends it to the concentrator side. We are using concentrator code in two different ways, one which sends acknowledgement and one which doesn't.

When the concentrator side which isn't sending acknowledgement is connected to the node side the temperature values are accurate. But when the node connects to concentrator side which sends acknowledgement the temperature value jumps by 0.2C which is not acceptable for our application. 

We have been trying to figure out why this would be the case, any suggestion/help would be appreciated.

2. The other thing we were trying to figure out is related to SCS:

We are using SCS on the node side, the code is as given below,

adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P73_MS, ADC_TRIGGER_MANUAL);

S16 adcvalue = 0;

if (state.samplesSinceLastReport == 0) {

output.thermadcValue[0]=0;

output.thermadcValue[1]=0;

output.thermadcValue[2]=0;

output.thermadcValue[3]=0;

}

// Sample the thermistors sensor

for (U16 n = 0; n < 4; n++) {

adcvalue = 0;

// Select ADC input

adcSelectGpioInput(cfg.pAuxioAThermistor[n]);

adcGenManualTrigger();

adcReadFifo(adcvalue);

output.thermadcValue[n] = adcvalue + output.thermadcValue[n];

}

// Disable the ADC

adcDisable();

state.samplesSinceLastReport = state.samplesSinceLastReport + 1;

if (state.samplesSinceLastReport == 10) {

fwGenAlertInterrupt();

state.samplesSinceLastReport = 0;

}

// Schedule the next execution

fwScheduleTask(1);

The code in the nodeTaskFunction is:

SceAdc_init(0x00001000, 0x000);
SceAdc_registerAdcCallback(adcCallback);
SceAdc_start();

We are trying to figure out how adcEnableSync and SceAdc_init affect the samples being transmitted and does this affect the accuracy of the system.

Thank you.

  • Hi Ashish,

    As for the parameters of SceAdc_init(), it should be somewhat clear from the naming of these what you are impacting by changing these: sampling time and report interval.

    On the matter of the ADC reading, have you tried to correlate this to radio activity? What I mean is have you made sure that the ADC conversion is not happening during the TX/RX exchange which could impact sensitive ADC readings?

    Best regards,

    Max
  • I checked and the ADC conversion is not happening while TX/RX. I am still trying to debug the issue.

    I have one more issue with the SCE code, we were using a for loop to calculate the ADC values on 3 inputs but now we are calculating the ADC values individually and we are seeing a difference of 1-2mV especially on the last input. The two codes:

    with for loop:

    for (U16 n = 0; n < 3; n++) {
    adcvalue = 0;
    // Select ADC input
    adcSelectGpioInput(cfg.pAuxioAThermistor[n]);
    adcGenManualTrigger();
    adcReadFifo(adcvalue);
    output.thermadcValue[n] = adcvalue + output.thermadcValue[n];
    }

    without for loop:

    S16 adcvalue = 0;

    adcSelectGpioInput(cfg.pAuxioAThermistor[0]);

    adcGenManualTrigger();

    adcReadFifo(adcvalue);

    output.thermadcValue[0] = adcvalue + output.thermadcValue[0];

    S16 adcvalue1 = 0;

    adcSelectGpioInput(cfg.pAuxioAThermistor[1]);

    adcGenManualTrigger();

    adcReadFifo(adcvalue1);

    output.thermadcValue[1] = adcvalue1 + output.thermadcValue[1];

    S16 adcvalue2 = 0;

    adcSelectGpioInput(cfg.pAuxioAThermistor[2]);

    adcGenManualTrigger();

    adcReadFifo(adcvalue2);

    output.thermadcValue[2] = adcvalue2 + output.thermadcValue[2];

    I am not able to figure out why this is happening, have you seen this before? Any help would be appreciated.

    Thank you for your help in advance.

  • What sample time is the ADC setup to, have you tried increasing the sample time?
  • The current sample time is 2.73 ms, we will try increasing the time and see. But I am still unable to understand why changing from for loop to individual calculation will affect lead to difference in 1-2 mV reading? 

  • Hi Ashish,

    The only reason I can think of is you changing the timings where the unrolled version is slightly quicker to execute and that this impacts your reading accuracy.
  • Closing the thread for now due to inactivity. Feel free to add to the thread or ask a related question if any new issues or information comes up.