Hi Ti Experts
We are making Ble Beacon project which will take temperature from LMT85 temperature sensor .We have few doubts from software side
1) How to configure pin as ADC(analog) as these pins are muliplexd having digital/gpio/analog option.
2) We are taking reading temperature from 23rd pin by assuming this pin as analog by default.Here we are facing accuracy issue.By oscilloscope we have measured reading as 1.38V but from ADC pin from software side we are getting 1339mV. What may be the issue.
The code we have used is following:-
pinHandle = PIN_open(&pinState, alsPins);
AUXWUCClockEnable(AUX_WUC_ADI_CLOCK|AUX_WUC_SOC_CLOCK|AUX_WUC_AIODIO0_CLOCK);
AUXADCSelectInput(ADC_COMPB_IN_AUXIO7);
//AUXADCEnableAsync(AUXADC_REF_FIXED, AUXADC_TRIGGER_MANUAL);
while(i<20)
{
AUXADCEnableSync(AUXADC_REF_FIXED,AUXADC_SAMPLE_TIME_2P73_MS, AUXADC_TRIGGER_MANUAL);
AUXADCGenManualTrigger();
adcsample[i++] = AUXADCReadFifo();
AUXADCFlushFifo();
AUXADCDisable();
}
for(i=0;i<20;i++)
{
singleSample+=adcsample[i];
}
singleSample/=20;
singleSample=AUXADCValueToMicrovolts(AUXADC_FIXED_REF_VOLTAGE_NORMAL,singleSample);
sprintf(buff,"sample : %d microvolt\r\n",singleSample);
SbpUartHandle = UART_open(CC2650_UART0, &SbpUartParams);
UART_write(SbpUartHandle, buff,strlen(buff));