Skip to main content
Visitor II
November 5, 2018
Question

Range setting in ISM330DLC

  • November 5, 2018
  • 10 replies
  • 2872 views

Hi All,

I am working on a project that is using ISM330DLC sensor for measuring the acceleration along the X,Y and Z-axis. 

When I set range 2G,4G and 8G I'm seeing difference in the sensor raw value and when I set it to 16G, I'm getting same data as 8G.

eg: 

Z-axis data:

2G : 1030 

4G : 517

8G : 258

16 : 256  

Regards, 

Dom

    This topic has been closed for replies.

    10 replies

    ST Employee
    November 5, 2018

    What is your sensor configuration?

    Are the reported values really raw data from the sensor? It doesn't look to me.

    If not how do you convert the raw values from high and low register to mg?

    Visitor II
    November 5, 2018

    Below are configuration:

    ISM330DLC_CTRL3_C = 0x44        

    ISM330DLC_CTRL8_XL = 0x20            

    ISM330DLC_FIFO_CTRL5 = 00;          

    ISM330DLC_CTRL1_XL  = 0xA4;        

               

    ISM330DLC_FIFO_CTRL3 = 0x01;

    And reported values are all Z-axes raw data from the sensor for different ranges

    ST Employee
    November 5, 2018

    You read or interpret the output data incorrectly.

    You can do it in example as follows:

    int16_t result_lsb;

    float result_mg;

    result_lsb = ((int16_t)high_byte<<8)+(uint16_t)low_byte;

    result_mg = result_lsb * sensitivity; // LSB to mg, see sensitivity in datasheet

    Visitor II
    November 5, 2018

    0690X000006CJX0QAO.pngThis part I'm able to do ..

    My issue is for 8G and 16G, the raw data values are same..

    You can refer to the attached graph for more details..

    ST Employee
    November 5, 2018

    Your raw data for 2g and 4g look also the same.

    If you measure 1g of gravity the raw value for 2g range should be around 16000.

    I think you have some mistake in your program.

    How do you switch the full scale ranges?

    Visitor II
    November 5, 2018

    At run time dynamically we are not changing.

    For testing we are changing ISM330DLC_CTRL1_XL register and building and flashing.

    Visitor II
    November 6, 2018

    Do you have any sample project or source code.

    It would be really helpful

    ST Employee
    November 6, 2018
    Visitor II
    November 6, 2018

    Thanks,

    I'm using the same code as reference and I have modified according to my application requirement.

    But still I'm facing the same issue..

    Initialization code:

    ISM330DLC_WRITE(Register,value);///Prototype

    ISM330DLC_WRITE((0x12), 0x44);

    ISM330DLC_WRITE((0x17), 0x20 );

    ISM330DLC_WRITE((0x0A), 0x00);

    ISM330DLC_WRITE((0x10), 0xA0 );

    ISM330DLC_WRITE((0x0A), (0x50));

    ISM330DLC_WRITE((0x08), 0x01 );

    ISM330DLC_WRITE((0x0A), 0x56);

    ISM330DLC_WRITE((0x06), 0x30);

    ISM330DLC_WRITE((0x0D), 0x08 }

    Read data part:

    typedef struct{ // Result structure

      int16_t acc_x;

      int16_t acc_y;

      int16_t acc_z;

    } lsm_data;

    ISM330DLC_READ(FIFO_DATA_OUT_L,lsm_data);

    ST Employee
    November 9, 2018

    Please share your complete project, there must be somthing wrong.