Hi,
I am trying to read an analog input from a temperature sensor using the sensor controller. I modifiied the adc_data_logger example to function as below:
- change the ADC sensor output to the I/O that is connected to the temperature sensor.
- Disable scaling. (using 1.44V reference voltage)
- removed the ring buffer, directly read adc fifo to output.adcValue.
- Enable system CPU alert once ADC conversion is done.
My execution code as below:
/*******************************************************************/
// Disable input scaling
adcDisableInputScaling();
// Enable the ADC
adcEnableSync(ADC_REF_FIXED, ADC_SAMPLE_TIME_2P7_US, ADC_TRIGGER_MANUAL);
// Sample the sensor
adcGenManualTrigger();
adcReadFifo(output.adcValue);
// Disable the ADC
adcDisable();
// Notify the driver
fwGenAlertInterrupt();
// Schedule the next execution
fwScheduleTask(1);
/******************************************************************/
The temperature voltage is suppose to be 0.972V as measured from the meter but the ADC conversion result is about 0.93V ~ 0.94V. This result shows that there is an error rate of 3~4%.
Is there anything I miss out or wrongly implemented?
I read the ADC help from Sensor Controller Studio and there is a statement mentioned below:
The ADC values returned by adcReadFifo() are not compensated for offset and gain errors in the ADC. This compensation, using factory configuration data stored during chip production, can be done by using the AUX_ADC DriverLib module on the System CPU to:
- Adjust ADC values sampled by the Sensor Controller (through the output data structure)
- Unadjust ADC threshold values to be used in Sensor Controller task code (through the cfg data structure)
1) May I know how this can be done? I am using ble_cc26xx_2_00_00_42893.
2) Any other advises is also appreciated.