I am using ADS131E08S with PIC18f26k22 for reading Force sensor values. The sensor which i am using is FSG020WNPB.
These are my register settings,
CONFIG1 0xF2
CONFIG2 0xE0
CONFIG3 0xE8
CH1SET 0x20
After initialization of registers using below code i am reading values from ADC and printing it on the terminal.
************************************************************************************************************************************************
CS = 0;
PORTCbits.RC0 = 1; //start pin making high
spiwritecommand(ADC_START_CMD);
CS = 1;
CLOCK = 0;
__delay_us(10);
CLOCK = 1;
PORTCbits.RC1 = 1; //making DRDY pin as low
//as per Data sheet Issue this command after DRDY goes low to read the conversion result
CS = 0;
spiwritecommand(ADC_READ_DATA_CMD);
CS = 1;
char pri[15];
int x;
CS = 0;
for(x=0;x<27;x++)
{
adcArray[adcArrayIndex] = spi_write(0x00);
adcArrayIndex++;
}
CS = 1;
adcvalue1 = Parse_24bit_adc_values(CHANNEL1_INDEX);
sprintf(pri,"%ld",adcvalue1);
sendResponseViaUart(pri);
uartWriteByte(0x0D);
PORTCbits.RC0 = 0;
*******************************************************************************************************************************************************
i am converting the Values read by ADC into voltage by using below equation,
voltage = ADC value * Vref / ADC resolution
where Vref = 2.4V
these are the values and corresponding voltages i am getting, while applying force on the Force sensor
ADC value Voltage
12615897 | 1.797199 |
14409920 | 2.052767 |
14729408 | 2.098279 |
I have tried connecting a potentiometer to the channel 1 and applied a fixed voltage
0.348V(fixed voltage) on potentiometer | |||
16711696 | 2.380666 | ||
65552 | 0.009338 | ||
262120 | 0.03734 | ||
0.257V(fixed voltage)on potentiometer | 8323072 | 1.185664 | |
589840 | 0.084026 | ||
393232 | 0.056018 | ||
196624 | 0.02801 | ||
720912 | 0.102698 | ||
655376 | 0.093362 |
Everytime the values are keep on changing. Even if applied any fixed voltage also the values(Read by ADC) s changing.
Kindly advice how to proceed further.