2015-01-26 09:47 PM
1) Question1 I am reading the the data sheet of LIS3DH AN3308. I doubt about the description of 3.2.3(Example of accleration data).
350(0x15E)mg register data is Val_0x29 = 0x15, Val_0x28 = E0 (left-justified)It is OK of BLE1g(0x400mg) register data is Val_0x29 = 0x04, Val_0x28 = 0x00Is it correct example?? I think it should be Val_0x29 = 0x40, Val_0x28 = 0x002) I download LIS3DH driver code from st.com stsw-mems023_LIS3DH Linux OS device driver.zipthe get acceleration data code is as the following, acc_data[0] = (AXISDATA_REG); err = lis3dh_acc_i2c_read(stat, acc_data, 6); hw_d[0] = (((s16) ((acc_data[1] << 8) | acc_data[0])) >> 4); hw_d[1] = (((s16) ((acc_data[3] << 8) | acc_data[2])) >> 4); hw_d[2] = (((s16) ((acc_data[5] << 8) | acc_data[4])) >> 4);In fact, the output resolution is 12bit, not 16bit ???I found the output resolution description at LIS2DH data sheetBut not found at LIS3DH, In AN33083.2.1 Data alignment Acceleration data are represented as 16-bit numbers and are left justified.Thanks #lis3dh-data-format2015-01-27 08:50 PM
<AN3308>
9.1 FIFO descriptionThe FIFO buffer is able to store up to 32 acceleration samples of 10 bits for each channel; data are stored in the 16-bit 2’s complement left justified representation.