![]() |
|
If you can't view the Datasheet, Please click here to try to view without PDF Reader . |
|
Datasheet File OCR Text: |
june 2009 doc id 15761 rev 1 1/28 AN2989 application note lis331dlm: 2 g /4 g /8 g digital output high performance ultra low-power 3-axis accelerometer introduction this document provides application information for the low-voltage 3-axis digital output linear mems accelerometer housed in an lga package. the lis331dlm is a high performance ultra low-power 3-axis linear accelerometer which belongs to the ?nano? family of mems accelerometers, with digital i 2 c/spi serial interface standard output. the device features ultra low-power operational modes that allow advanced power saving and smart sleep to wake functions. the lis331dlm has dynamically user-selectable full scales of 2 g /4 g / 8 g and is capable of measuring acceleration with output data rates from 0.5 hz to 400 hz. the self-test capability allows th e user to check the functioning of the sensor in the final application. the device can be configured to generate interrupt signals in response to inertial wakeup/free-fall events or based on the position of the device itself. the thresholds and timing of interrupt generators are programmable by the end user ?on the fly?. the lis331dlm is available in a small, thin plastic land grid array (lga) package and is guaranteed to operate over an wide temperature range of -40 c to +85 c. www.st.com
contents AN2989 2/28 doc id 15761 rev 1 contents 1 register table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 2 startup sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1 reading acceleration data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1 using the status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.2 using the dataready signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2 output data rate selection and reading timing . . . . . . . . . . . . . . . . . . . . . . 8 2.3 dataready vs. interrupt signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.4 understanding acceleration data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4.1 data alignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 2.4.2 example of acceleration data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3 operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.1 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.2 power-down mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.3 low-power mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.4 sleep to wake . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 3.4.1 entering sleep to wake mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.4.2 exiting sleep to wake mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4 high-pass filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.1 filter configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 4.1.1 normal mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1.2 reference mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 5 interrupt generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.1 duration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 5.2 threshold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.3 free-fall and wake-up interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5.4 inertial wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.4.1 hp filter bypassed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 5.4.2 using the hp filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 AN2989 contents doc id 15761 rev 1 3/28 5.5 free-fall detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.6 6d direction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 6 revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 list of tables AN2989 4/28 doc id 15761 rev 1 list of tables figure 1. reading timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 2. interrupt and dataready signal generation block diagram. . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 3. dataready signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 4. sleep to wake mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 figure 5. high-pass filter connections block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 6. hp_filter_reset readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 7 figure 7. reference mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 8. free-fall, wake-up interrupt generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 9. ff_wu_cfg high and low. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 10. inertial wakeup interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 11. free-fall interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 figure 12. zh, zl, yh, yl, xh, xl behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 13. 6d movement vs. 6d position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 14. 6d recognized positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 AN2989 list of figures doc id 15761 rev 1 5/28 list of figures figure 1. reading timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 figure 2. interrupt and dataready signal generation block diagram. . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 3. dataready signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 4. sleep to wake mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 figure 5. high pass filter connections block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 figure 6. hp_filter_reset readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 7 figure 7. reference mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 figure 8. free-fall, wakeup interrupt generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 9. ff_wu_cfg high and low. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 figure 10. inertial wakeup interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 figure 11. free-fall interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 figure 12. zh, zl, yh, yl, xh, xl behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 13. 6d movement vs. 6d position . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 figure 14. 6d recognized positions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 register table AN2989 6/28 doc id 15761 rev 1 1 register table table 1. register table register name address bit7 bi t6 bit5 bit4 bit3 bit2 bit1 bit0 who_am_i 0fh 0 0 0 1 0 0 1 0 ctrl_reg1 20h pm2 pm1 pm0 dr1 dr0 zen yen xen ctrl_reg2 21h boot hpm1 hpm0 fds hpen2 hpen1 hpcf1 hpcf0 ctrl_reg3 22h ihl pp_od lir2 i2_cf1 i2_cf0 lir1 i1_cf1 i1_cf0 ctrl_reg4 23h bdu ble fs1 fs0 stsign 0 st sim ctrl_reg5 24h - - - - - - turnon1 turnon0 hp_filter_reset 25h - - - - - - - - reference 26h ref7 ref6 ref5 ref4 ref3 ref2 ref1 ref0 status_reg 27h zyxor zor yor xor zyxda zda yda xda out_x 29h xd7 xd6 xd5 xd4 xd3 xd2 xd1 xd0 out_y 2bh yd7 yd6 yd5 yd4 yd3 yd2 yd1 yd0 out_z 2dh zd7 zd6 zd5 zd4 zd3 zd2 zd1 zd0 int1_cfg 30h aoi 6d zhie zlie yhie ylie xhie xlie int1_src 31h - ia zh zl yh yl xh xl int1_ths 32h 0 ths6 ths5 ths4 ths3 ths2 ths1 ths0 int1_duration 33h 0 d6 d5 d4 d3 d2 d1 d0 int2_cfg 34h aoi 6d zhie zlie yhie ylie xhie xlie int2_src 35h - ia zh zl yh yl xh xl int2_ths 36h 0 ths6 ths5 ths4 ths3 ths2 ths1 ths0 int2_duration 37h 0 d6 d5 d4 d3 d2 d1 d0 AN2989 startup sequence doc id 15761 rev 1 7/28 2 startup sequence once the device is powered up it automatically downloads the calibration coefficients from the embedded flash to the internal registers. when the boot procedure is complete (after approximately 5 milliseconds), the device automatically enters power-down mode. to turn on the device and gather acceleration data, it is necessary to select one of the operating modes through the ctrl_reg1 register, and to enable at least one of the axes. the following general-purpose sequences can be used to configure the device: 1. write ctrl_reg1 2. write ctrl_reg2 3. write ctrl_reg3 4. write ctrl_reg4 5. write reference 6. write int1_ths 7. write int1_dur 8. write int2_ths 9. write int2_dur 10. read hp_filter_reset (if filter is enabled) 11. write int1_cfg 12. write int2_cfg 13. write ctrl_reg5 register values can be changed at any time, with the device in any operating mode. modifications take effect immediately. note that in case of changes in full scale, odr or enabling/disabling of self-test, the output of the device requires 3 to 8 samples to settle (see ta bl e 1 1 ). in cases where the hp filter cut-off frequency is ch anged, the filter can be reset by reading hp_filter_reset register. startup sequence AN2989 8/28 doc id 15761 rev 1 2.1 reading acceleration data 2.1.1 using the status register the device is provided with a status_reg which should be polled to check when a new set of data is available. the reading procedure should be the following: the check performed at step 3 determines whether the reading rate is adequate compared to the data production rate. in cases where one or more acceleration samples have been overwritten by new data due to an excessively slow reading rate, the zyxor bit of status_reg is set to 1. the overrun bits are automatically cleared when all the data present inside the device have been read and new data have not been produced in the meantime. 2.1.2 using the dataready signal the device may be configured to have one hw signal to determine when a new set of measurement data is available for reading. this signal is represented by the xyzda bit of the status_reg register. the signal can be driven to the int1 or int2 pins and its polarity set to active-low or active-high through the ctrl_reg3 register. the interrupt is reset when the higher part of the data of all the enabled channels has been read. 2.2 output data rate se lection and reading timing the output data rate is user selectable through the drx bits of the ctrl_reg1 (20h) register. at power-on-reset, the drx are reset to 0, thus providing a default output data rate of 50 hz. the analog signal coming from the mechanical sensor is filtered by a low pass filter before being converted by the internal adc. the frequency at -3 db of the low pass filter determines the effective system resolution. the cut-off frequency depends on the dr<1:0> bits in the ctrl_reg1 (20h) register ( ta bl e 2 ). 1 read status_reg 2 if status_reg(3) = 0 then goto 1 3 if status_reg(7) = 1 then some data have been overwritten 4 read outx_l 5 read outx_h 6 read outy_l 7 data processing 7 goto 1 AN2989 startup sequence doc id 15761 rev 1 9/28 note: the precision of the output data rate is related to the internal osc illator; an error of +/- 10% should be taken in account. a typical reading period is defined which is 616 s shorter than the output data rate period, in order to prevent the loss of any data produced. during this time period the reading of the data must be performed and the dataready signal can be used as a trigger to begin the reading sequence. at the end of the complete sequence, the dataready signal goes down and the rising edge that follows signals that new data are available. if this minimum reading frequency is not observed, some data loss is possible and the dataready signal no longer signifies a trigger signal. the status register can be used to infer whether an overrun has occurred. figure 1. reading timing 2.3 dataready vs. interrupt signal the device is equipped with two pins that can be activated to generate either the dataready or the interrupt signal. the functionality of the pins is selected acting on bit i1(2)_cfgx bits of the ctrl_reg3 register, according to ta b l e 4 and with the block diagram given in figure 2 . table 2. output data rate dr1, dr0 output data rate analog filter cut-off frequency. (-3 db) 00 50 hz 37 hz 01 100 hz 74 hz 10 400 hz 292 hz table 3. timing value to avoid losing data time description min t0 data rate 1/odr t1 reading period t0-t2 t2 new data generation (typ) 616 s $ a t a 2 e a d y 4 4 4 . e w d a t a a v a i l a b l e ! - v table 4. data signal on int 1 and int 2 pads i1(2)_cfg1 i1(2)_cfg0 int 1(2) pin 0 0 interrupt 1 (2) source 0 1 interrupt 1 source or interrupt 2 source 1 0 dataready 1 1 boot running startup sequence AN2989 10/28 doc id 15761 rev 1 figure 2. interrupt and dataready signal generation block diagram in particular, the dataready (dr) signal rises to 1 when a new set of acceleration data has been generated and is available for reading. the signal is reset after all the enabled channels are read through the serial interface. figure 3. dataready signal 2.4 understanding acceleration data the measured acceleration data are sent into the outx, outy, outz registers. acceleration data for the x (y, z) channel is expressed as a 2?s complement number. 2.4.1 data alignment acceleration data are represented as 8-bit numbers, two?s complement and are right justified. 2.4.2 example of acceleration data ta bl e 5 provides a few basic examples of the data that is read in the data registers when the device is subject to a given acceleration. the values listed in the table are given under the hypothesis of perfect device calibration (no offset, no gain error, etc.). ! - v & |