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.

How to read ADC value from LMP90080

Other Parts Discussed in Thread: LMP90080, LM4140, LMP90100

Hi, 

     I am using LMP90080 to read thermocouple' s voltage, I am connecting 4 thermocouples to  8 adc pins(VIN0 TO VIN7).when I am reading ADOUT register I am getting some values but how to find the particular channel output is this and next channel output is this one.Please help me, I stuck's here for so many days.

Thanks in Advance

vijay kumar

  • Hello,

    Read 3 registers in a row, registers 0x19, 0x1A and 0x1B.  Register 0x19 bits [2:0] show the channel that corresponds to the data in ADC_OUTD.  See pages 32 and 55 in the datasheet.

    Mike

  • Thank you for the reply Mike,

          I tried that now  I can get values from each channel. But I got other problems.

          Note:This project is based on Thermocouple reading, So the values will be in milli volts

      1. How to convert that adc value into mVolts.

      2. I am giving constant voltage (in mVolts) to one channel, while reading I am getting Adc value, and when I am  reading the same channel again I am getting the adc value in difference of 20 to 30. How to Keep the reading constant. Actually I am poor in Those ADC Settings. I have a doubt that  which value we have to give to background calibration, Gain, buf_en pin, scalcn register , scaling process.

    Which values I have to give to get constant value. Please  help me.

    Thanks in Advance

    vijay kumar

  • Hello,

    1.  On page 40 of the datasheet is an equation that relates the ADC code to the voltage at the input pins.  You can use the inverse of that equation to determine the input voltage.

    2.  Set up your registers as shown in the quick start on page 40.  Make sure that your VA, VIO, and VREF are good and have bypassing as shown on page 40.  Once it is working with these settings you can start to adjust them as needed.

    Mike

  • Hello,

    Let me explain with one example for reading lmp90080 adc ic

    vref  is 3.3v, and my input is (Vin0-Vin1)= 7.30mv

    for this voltage i am getting 0x0049 (73 in decimal)as a reply

    The Basic formula is

    ADC_DOUT =[ (Vin0-Vin1)/vref  ]*(2power of 15)

    So to get applying volatge

     (Vin0-Vin1) =[( ADC_DOUT )/(2power of 15)]*vref  

    ==> (Vin0-Vin1) = (73*3.3)/32767

    ==> (Vin0-Vin1) = 0.00735v

    ==> (Vin0-Vin1) = 7.35mv

    this is how i am using calculation

    Like this with the same values of inputs, I am measuring again I am getting 81(in decimal)

    from that calculation

    ==> (Vin0-Vin1) = 8.15mv 

    generally this is very small difference but in my project we are measuring Thermo couple voltage for this small difference it is big difference in temperature. So it  is very necessary to decrease the difference.

    Please give some guide lines to reduce the difference.

    Thanking you advance 

    vijay kumar

  • Hello Mike,

    Can you tell me something about ODR, if we change the ODR values what will happen.

    Thanking you

    vijay kumar.M

  • Hello,

    Some things you can check:

    Is the input voltage stable?  The difference between the two reading is only 0.8mV and if you are using a power supply, it could be moving around that much or more.  If you are using a thermocouple is the temperature changing between the measurements?

    Vref needs to be very stable.  The same applies for this, if a power supply is used Vref could be moving around.  You can try using a reference like the low noise LM4140.

    Mike

  • Hello,

    Choosing a lower ODR will give you less noise.  The part is taking more samples and averaging them when using the lower ODR rates. 

    If you try the online tool for the LMP90100 you can try various setups of ODR and it will show you what the performance of the part should be.

    Mike

  • Thank you again Mike,

             You are correct. Changing the ODR value to low is giving perfect value.

             I want to ask you Again one more question,

             While I am using 3.3v as reference, for  every 0.1mv difference i am getting 1 bit change in the adc output.

    Sorry I dont know what are exact word to use there

    see 32767 value  is for 3.3v

    ==> 1 value 3.3v/32767 

    ==> 1 value = 0.000107v

    ==> 1 value = 0.1mv

    But for this project we want 1bit change = 0.005mv difference

    here if we use lmp90100 that is best solution. But our client is not accepting to change the IC.

    So is there any option to measure that difference. The maximum input voltage to pins is 90mV.

    Thanking you

    vijay kumar

  • I am also used 1v as reference but it is giving 0.03mv variation only

    vijay kumar

  • Hello Mike,

    I tried that (lmp90080) by  using vref=1v(It is constant voltage supply)and gain =8 and for every adc count, I am getting 0.005mv resolution(nearly).

    But the adc value not constant though I am using odr=1.6775sps. Adc value is varying continuously with 20 bits range. How to make it stable. 

    In thermocouple(R type), for every 0.005mv change gives 1degree variation. In this project we have to measure voltage in 0.005mv range.

    So i want to make this with 0.005mv resolution and Constant output.

    This is my coding part, Please tell me any mistake is there in my code and Give a solution for my problem.

    void ADC_chnl_init(void)
    {
    ADC_Write(0x10,0x00,0x00,0xC3);//reset
    ADC_Write(0x10,0x01,0x02,0x20);//ADC_AUXCN
    ADC_Write(0x10,0x01,0x00,0x02);//BGCALCN
    ADC_Write(0x10,0x01,0x0F,0x00);//CH_SCAN

    ADC_Write(0x10,0x02,0x00,0x08);//ch0_inputcn
    // ADC_Write(0x10,0x02,0x01,0x00);//ch0_config gain= 0,odr=1.6775sps
    ADC_Write(0x10,0x02,0x01,0x06);//ch0_config gain= 8,odr=1.6775sps
    // ADC_Write(0x10,0x02,0x01,0x36);//ch0_config gain= 8,odr=13.42sps;
    // ADC_Write(0x10,0x02,0x01,0x76);//ch0_config gain= 8,odr=214.65sps
    //ADC_Write(0x10,0x02,0x01,0x30);//ch0_config gain=0;
    //ADC_Write(0x10,0x02,0x01,0x70);//ch0_config
    ADC_Write(0x10,0x00,0x0B,0x01); //adc restart
    }

    void ADC_Write(unsigned char cmd1,unsigned char cmd2,unsigned char cmd3,unsigned char cmd4)

    {
    YRDKRX62N_RSPI_Select(1);//this is for chip select

    *addr=cmd1;
    ADC_RSPI_Write(addr,1);
    // Delay_Mrite_Memory();

    *addr=cmd2;
    ADC_RSPI_Write(addr,1);
    // Delay_Mrite_Memory();

    *addr=cmd3;
    ADC_RSPI_Write(addr,1);
    // Delay_Mrite_Memory();

    *addr=cmd4;
    ADC_RSPI_Write(addr,1);

    YRDKRX62N_RSPI_Deselect(1);//this is for chip deselect
    }
    void ADC_READING(unsigned char cmd1,unsigned char cmd2,unsigned char cmd3,
    unsigned char*read,unsigned char bytes_no)
    {
    YRDKRX62N_RSPI_Select(1);//this is for chip select

    *addr=cmd1;
    ADC_RSPI_Write(addr,1);
    // Delay_Mrite_Memory();

    *addr=cmd2;
    ADC_RSPI_Write(addr,1);
    // Delay_Mrite_Memory();

    *addr=cmd3;
    ADC_RSPI_Write(addr,1);
    Delay_Mrite_Memory();
    ADC_RSPI_Read(read,bytes_no);

    YRDKRX62N_RSPI_Deselect(1);//this is for chip deselect
    }

    void ADC_ch0_sel(unsigned char * data)
    {
    ADC_Write(0x10,0x02,0x00,0x08);//ch0_inputcn
    // ADC_Write(0x10,0x00,0x0B,0x01);//restart
    ADC_READING(0x10,0x01,0xAA,(data),2);

    }

    void Delay_Mrite_Memory(void)

    {
    uint32_t Dly_Cnt = 0xFFFFF;
    while(Dly_Cnt--);
    }

    In my main function after initilization I am calling "ADC_ch0_sel(unsigned char * data) " function continuously with a delay of 10ms.

    Thanks in Advance

    Vijay kumar

  • Hello Mike,

                    Please give clarification on my doubts.

  • Hello,

    I think you are running into the noise floor of the LMP90080 by setting VREF so low.  As VREF is reduced, the range of acceptable analog input voltages is also reduced.  Reducing the value of VREF also reduces the size of the LSB.  When the LSB size goes below the noise floor of the LMP90080, the noise will span an increasing number of codes and performance will degrade.  For optimal performance, VREF should be the same as VA and sourced with a clean source that is bypassed with a ceramic capacitor value of 0.1 μF and a tantalum capacitor of 10 μF.

    It is probably best to change to the LMP90100.  Since you will then have 24 bits, you can set VREF to 5V.  The part is pin-to-pin compatible with the LMP90080 so no change is needed to the PCB.

    Mike

  • Hello,Mike

    if ODR =1.6775sps then how many times lmp90080 calibrate new value

    if ODR =214.65sps then what is the difference in calibration.

    can you explain this briefly about ODR.

  • Hello, Mike

    Thanks for your suggestion. Now we are thinking to change into LMP90100.

    But in lmp90080 ic's datasheet page number 9, table 1 to table 4 there are some values of ODR,ENOB(Noise free resolution), RMS noise and gain. Really I cant understand that relations.

         If ODR increases then ENOB  decreases and RMS noise increases there is no doubt in this but generally while increasing gain it should increase noise also but here it is in reverse.

    In page no 14 those typical performance characteristics also if we increase gain then noise is going down.

    Can you Please explain that tables and Graphs

    And to measure 0.01mv which setting(ODR, GAIN) is best one.

  • Hello,

    ODR is how many samples you get per second.  So if you are set to 1.6775SPS, there will be a new conversion available every 1.6775 seconds. 

    It is doing the calibration every time it does a conversion.  So if using BgcalMode2 the actual ODR is reduced since it is doing the calibration every conversion.  Page 26 of the datasheet has the information that shows how much the ODR is reduced.

    In answer to your question about ENOB and Noise Free Resolution see the definitions on page 13 of the datasheet.  ENOB is for a perfect ADC and NFR is specified taking into account the noise.

    The noise measurements are correct.  This has to do most likely with the internal data path and the amplifiers and internal gain setting resistors used.

    I would select the lowest ODR to start with.  Temperature measurement usually is not a fast moving measurement.  Gain selection depends on the input signal.  What is the largest input signal that you will have at the input?  Select a gain that will give you the largest output that doesn't over range the ADC.

    Mike

  • Thanks Mike,

    In our project we have to measure 16 different temperatures in one second.

    Now we are using odr=53.6625.  for every measurement we are taking 10 times average because we are not getting constant output. So for every second we can measure up to 5 different temperatures, so please show me the way to increase measurements.

    Here taking average is necessary as i mentioned the cause. If i increase odr value the adc value is changing with more range then again i have to increase the average counts.

    Thanks in advance

    vijay

  • Hello,

    Ways to make the measurement more stable are:

    Make sure Vref = VA = 5V.

    Have caps on the Vref and VA pins, they should be a 0.1uf ceramic and a 1uF tantalum on the VA pin and a 0.1uF ceramic and 10uF tantalum on the Vref pin.  The 0.1uF caps should be as close as possible to the pins and have very short connections to ground.

    Use the 2.2uF and 10nF filter capacitors connected to the thermocouple shown in figure 72 of the LMP90100 datasheet.

    Mike

  • Hello Mike,

              I want one clarification.

             While reading first time I am configuring ch0 to 0x08(that is Vin1-Vin0)

             here it is okay But for next read I am configuring ch0 to 0x1A(that is Vin3-Vin2), when i am reading this it is giving  Vin1-Vin0 value, If read again with same configuration I getting  Vin3-Vin2 value. 

             Tell me how to come out from this problem.

  • Hello,

    Try setting up ch0 with 0x08 and ch1 with 0x1A.  Then put the part in ScanMode2 or 3 (page 32 of the datasheet), set it up so that it scans starting at ch0 and ends at ch1 and use DRDYBCase 3 (page 40).  Then monitor pin D6.  Every time there is new conversion data D6 will be pulled low.  Read registers 0x19 through 0x1C.  Register 0x19 bits 2:0 indicate what channel the data is for and registers 0x1A to 0x1C are the data.

    Mike

  • Hello, 

     Let me Explain my problem here.

    there are 16 thermo couples, I have to read all the 16 values and I have to store it in memory.

    Each 4 thermocouples are connected to one cd4052 multiplexer and it's output is connected to lmp90100 

    Like this totally 4 CD4052 multiplexers output is connected to lmp90100.

    And now we are using Vref as lm4140-4.1v output.

    As i already told you we have to measure Thermocouple voltage. But This will be voltage in milli volts, of course some times it will be micro volts for some other thermocouples type.

    Why I am telling this is we have to measure micro volts.

    Firstly I am measuring ch0 ---> vin1-vin0

    next Ch0 ----> vin3-vin2

    next ch0 ----->vin5-vin4

    at last ch0----> vin7-vin6

    Like this i am reading values.

    here how much time gap i have to give for each reading.

    And while i am not connecting any input to one of the channel and if i tried to read that channel some times it is giving low value and sometimes it is giving negative values.

    to get zero here what i have to do.

    Thanks & Regards

    vijay kumar

  • Hello Vijay,

    1. When you reconfigure CH0, go to Stand-by -> chane the value > Change to active state.

    2. When you have not connected any input to channel, it is floating . You will not get Zero in this state. In order to get a stable low value close to zero, connect the inputs to ground.

    Regards,
    Murali

  • Hello, Murali

    Thank you for your reply

              My point is when I connected thermocouple to one channel, some times In the middle of the process due to some reasons the wires may be disconnect. How to find out this.