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.

ads7822 reading problem

Other Parts Discussed in Thread: ADS7822

Dear All, this is my first post. I hope writing on the right section.

My target is to measure analog source which is between 6mV to 40mV.

Instead of using op-amp (which means a lot of noise or a lot sampling for me & I need 3 opamps, because I need 3 different readings) I'm using x3 ADS7822 with 400mV vref supplied by LT6650. I have 400mV/4096 resolution and noise reduction with relatively less cost. 

Microcontroller is MSP430 and code developed with CCS energina. 

The problem is; I have the source measured 6.6mV. However adc reading I received is '73'. 

400mV divided by 2^12 (4096) is 0,09765625

73 * 0,09765625 = 7.12mV 

There is some difference on the measurement. Are there some problem on the adc reading code? I tried with 377mV source and the adc reading was 3640.

Here is the code;

long int get_ads()

{

long int data = 0;

short int delay_time = 1;

//Start new conversion Cycle

digitalWrite(P1_5, HIGH); // set CS high //PIN_SET(ADS7822_CS);

delay(2);

digitalWrite(P1_5, LOW); // set CS low //PIN_CLEAR(ADS7822_CS); // enable ADS7822

digitalWrite(P1_6, LOW); // set CLCK low //PIN_CLEAR(ADS7822_CLK);

delay(1);

// first 3 bits

for(int k=0; k<3; k++)

{

    digitalWrite(P1_6, HIGH);  // set clk high

    delay(delay_time);

    digitalWrite(P1_6, LOW);   // set clk low

    delay(delay_time);

}

for (int c = 0; c < 12; c++)

{

if(digitalRead(P1_4) == HIGH) data |= 0x0001;

if(c < 11) data <<= 1;

digitalWrite(P1_6, HIGH);

delay(delay_time);

digitalWrite(P1_6, LOW);

delay(delay_time);

}

digitalWrite(P1_5, HIGH); // set CS high disable ADS7822

delay(delay_time);

return data;

}

 

many thanks,