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.

lmp90100

Other Parts Discussed in Thread: LMP90100

Hi...

how to configure lmp90100 internal registers for strain guage weight application.

  • Hello Andre,

    Go to the LMP90100 web page on ti.com.  On the right side of the page there is a Webench box.  Select Load and then click on Open Design.  Follow through on the instructions and when you are done you can save the register settings.  You can then adjust them as needed for the load cell you are using.

    Mike

  • Hello Mike,

    thank you,

    Andre
  • Hi mike,

    I have configured internal registers of lmp90100 for strain gauge application and I am not getting any output from that, please suggest me that my configuration rifgt or wrong,,

    register configured

    #include <SPI.h>

    void setup(){

    pinMode (A0, OUTPUT);
    Serial.begin(9600);
    digitalWrite(SS, HIGH);
    SPI.begin();
    SPI.beginTransaction(SPISettings(8930000, MSBFIRST, SPI_MODE0));

    // adc restart
    digitalWrite(SS, LOW);
    SPI.transfer(0x0B);
    SPI.transfer(0x01);
    digitalWrite(SS, HIGH);


    //adc aux_cn
    digitalWrite(SS, LOW);
    SPI.transfer(0x12);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //adc_done
    digitalWrite(SS, LOW);
    SPI.transfer(0x18);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);
    /*
    //adc_douth
    digitalWrite(SS, LOW);
    SPI.transfer(0x1A);
    SPI.transfer(); //not complited
    digitalWrite(SS, HIGH);

    //adc_doutm
    digitalWrite(SS, LOW);
    SPI.transfer(0x1B);
    // SPI.transfer(); // not complited
    digitalWrite(SS, HIGH);

    //adc_doutl
    digitalWrite(SS, LOW);
    SPI.transfer(0x1C);
    // SPI.transfer(); // not complited
    digitalWrite(SS, HIGH);
    */

    //spi crc cn
    digitalWrite(SS, LOW);
    SPI.transfer(0x13);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);
    /*
    //spi crc dat
    digitalWrite(SS, LOW);
    SPI.transfer(0x1D);
    SPI.transfer(); //not complited
    digitalWrite(SS, HIGH);
    */

    //background caclcultion
    digitalWrite(SS, LOW);
    SPI.transfer(0x10);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //scanlcn
    digitalWrite(SS, LOW);
    SPI.transfer(0x17);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //ch0
    digitalWrite(SS, LOW);
    SPI.transfer(0x30);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x31);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x32);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x33);
    SPI.transfer(0x80);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x34);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x35);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x36);
    SPI.transfer(0x01);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x38);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x39);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x3A);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //ch1
    digitalWrite(SS, LOW);
    SPI.transfer(0x3B);
    SPI.transfer(0x80);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x3C);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x3D);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x3E);
    SPI.transfer(0x01);
    digitalWrite(SS, HIGH);

    //ch2
    digitalWrite(SS, LOW);
    SPI.transfer(0x40);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x41);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x42);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x43);
    SPI.transfer(0x80);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x44);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x45);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    // load cell CH1
    digitalWrite(SS, LOW);
    SPI.transfer(0x22);
    SPI.transfer(0x13);
    digitalWrite(SS, HIGH);

    digitalWrite(SS, LOW);
    SPI.transfer(0x23);
    SPI.transfer(0x6B);
    digitalWrite(SS, HIGH);


    //ch status
    digitalWrite(SS, LOW);
    SPI.transfer(0x1E);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //ch scan
    digitalWrite(SS, LOW);
    SPI.transfer(0x1F);
    SPI.transfer(0x18);
    digitalWrite(SS, HIGH);

    //gpio dircn
    digitalWrite(SS, LOW);
    SPI.transfer(0x0E);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    /*
    //gpio dat
    digitalWrite(SS, LOW);
    SPI.transfer(0x0F);
    SPI.transfer(); // not complited
    digitalWrite(SS, HIGH);
    */

    //resetcn
    digitalWrite(SS, LOW);
    SPI.transfer(0x00);
    SPI.transfer(0xC3);
    digitalWrite(SS, HIGH);

    //pwrcn
    digitalWrite(SS, LOW);
    SPI.transfer(0x08);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //spi handshakecn
    digitalWrite(SS, LOW);
    SPI.transfer(0x01);
    SPI.transfer(0x01);
    digitalWrite(SS, HIGH);

    //spi streamcn
    digitalWrite(SS, LOW);
    SPI.transfer(0x03);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //spi drdyb
    digitalWrite(SS, LOW);
    SPI.transfer(0x11);
    SPI.transfer(0x83);
    digitalWrite(SS, HIGH);

    //sendiag thldh
    digitalWrite(SS, LOW);
    SPI.transfer(0x14);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    //sendiag thldl
    digitalWrite(SS, LOW);
    SPI.transfer(0x15);
    SPI.transfer(0x00);
    digitalWrite(SS, HIGH);

    /*
    //sendiag flags
    digitalWrite(SS, LOW);
    SPI.transfer(0x19);
    SPI.transfer(); // not complited
    digitalWrite(SS, HIGH);
    */
    }



    andre
  • Hi Andre,

    When you are writing and reading the registers are you following the Protocol as shown in section 9.5.3, 9.5.4 and 9.5.14?

    It may be better to start with only writing to a few registers at first until you get your application working. There is no need to write to many of the registers such as the calibration registers at this point.

    As an example if you are using VREFP1 and VREFN1 and VIO=VA=VREFP1=5V, the top and bottom of the load cell are connected to VREFP1 and VREFN1 and the outputs of the strain gauge are connected to IN0 and IN1 you would set up the registers like this:

    Register Value
    0x12 00xx0000 set bits 5 and 4 depending on whether you are using an internal or external clock
    0x1F 00000000
    0x20 00000001
    0x21 01111000 start with a gain of 16 which may need to be modified

    0c0B 00000001 to restart the conversion
    Read registers 0x1A, 1B and 1C.

    Mike
  • Hi Mike,

    Yes I a trying to follow those sections(9.5.3, 9.5.4 and 9.5.14 ) but I am not clearly getting how to configure the registers because I am trying to do for the first time, just i am following data sheet for register configuration.

    i am using vin2 and vin3 as inputs to lmp90100 from two ends of load cell (connecting vrefp1 and vref n1 for other two ends of load cell).

    Andre
  • hi mike

    sorry i am using vin0 and vin1 not vin2 and vin3,

    andre
  • Hi mike,

    can I know how to read the regiters 0x1A, 1B and 1C using SPI, because I want to get the results on to serial monitor.

    Andre
  • Hi Andre,


    The sample register value setting that I gave above is for a load cell connected to VIN0 and VIN1 and using VREFP1 and VREFN1.  Since that is your setup it should be good for you. 

    Using the register values from above:

    0x12 00010000 (I AM ASSUMING YOU ARE USING AN EXTERNAL CLOCK IN THIS EXAMPLE)
    0x1F 00000000
    0x20 00000001
    0x21 01111000 start with a gain of 16 which may need to be modified

    0c0B 00000001 to restart the conversion

    You would write the following using the examples in 9.5.14:

    0x12 00010000:  Data sent: 0x10 0x01 0x02 0x10 (2 bytes setting URA to 1, 1 byte setting lower part of address to 2, 1 byte of data)
    0x1F 00000000:  Data sent: 0x0F, 0x00 (URA not needed because stays the same as previous, 1 byte setting lower part of address, 1 byte of data)
    0x20 00000001:  Data sent: 0x10 0x02 0x00 0x01 (2 bytes setting URA to 2, 1 byte setting lower part of address to 0, 1 byte of data)
    0x21 01111000:   Data sent: 0x01, 0x78 (URA not needed because stays the same as previous, 1 byte setting lower part of address, 1 byte of data)


    To read the ADC registers you would send:

    0x10, 0x01, 0xEA, 3 bytes of clock to read the data.  (2 bytes setting URA to 1, 1 byte setting lower part of address to A and setting to read 3 bytes, 3 bytes of data)

    Mike

  • Hi Mike

    thank you, one more last doubt to get the output which pin of lmp90100 should be connected as output,
    i am trying get the output by connecting D6 pin (Pin 27 of lmp90100 ) to A0 of arduino board and try to read the output using analogRead(); command. Am i doing right or Wrong?

    Andre
  • Hi Mike,

    yes it is load cell connected to VIN0 and VIN1 and using VREFP1 and VREFN1. i am using internal clock ( 0x12  - 0x20  ( 00110000)).
    I think for this we don't need use any current sources (IB1 abd IB2 of lmp90100),
    thank you

    Andre

  • Hi Andre,

    That is correct, you will not use the IB1 and IB2 sources for this. 

    The output is read through the SPI.  The D6 pin only shows when there is data ready to be read out by SPI.

    Mike

  • hi Mike

    what will be the state of D6 pin (1 or 0 ) if adc data is ready to read, can i make D6 to high when adc conversion data is available to read and D6 to 0 when there is no data to read.
    actually i tried to make like that to read 1 through D6 by connecting D6 to digital pin of arduino and using digitalRead(); but  i am getting only 0 every time,
    i configured register as (SPI.transfer(0x01); SPI.transfer(0x08);) in this configuration Routing DRDYB to D6, Am I right??

    Andre

  • Hello Andre,

    Section 9.5.11 shows how to set up the LMP90100 so that the D6 pin shows when there is ready to be read. D6 will give a pulse when there is data ready.

    Mike