Coder Social home page Coder Social logo

LIS3DH_DATARATE_LOWPOWER_5KHZ mode is not setting the accelerometer in 5kHz low power mode but in 1.344 kHz High resolution mode about adafruit_lis3dh HOT 12 CLOSED

adafruit avatar adafruit commented on August 26, 2024
LIS3DH_DATARATE_LOWPOWER_5KHZ mode is not setting the accelerometer in 5kHz low power mode but in 1.344 kHz High resolution mode

from adafruit_lis3dh.

Comments (12)

nalexopo avatar nalexopo commented on August 26, 2024 2

@erichiggins

Some suggestions from my part as I just saw that you replied.

  1. Don't use the datasheet from adafruit site but rather the one from ST site because it has been revised a few times from the 2010 version your link leads to. This is the 2016 version you can see some differences in the ODR that's why i am talking about 1.344 kHz and not 1.250 kHz.

Here the December 2016 version which is the current version.
https://www.st.com/resource/en/datasheet/lis3dh.pdf

  1. If you are planning on going full speed on this sensor have a look on the application note page 9/59
    you may be limited by bandwidth limitations when using HR mode.

https://www.st.com/content/ccc/resource/technical/document/application_note/77/ed/e7/e1/28/5a/45/d6/CD00290365.pdf/files/CD00290365.pdf/jcr:content/translations/en.CD00290365.pdf

from adafruit_lis3dh.

erichiggins avatar erichiggins commented on August 26, 2024

I was looking into setting a faster data rate in my sketch and came across this reported issue. I haven't tried implementing it yet, but I wanted to share some additional information from the docs in case it helps anyone to confirm (and/or fix) the issue reported above.

Based on what I've read and the information below, I believe the following code is needed to use low-power (5khz) mode. Please double-check before trying it for yourself.

// Enable all axes, low-power mode
writeRegister8(LIS3DH_REG_CTRL1, 0xf);
// 5khz data rate
setDataRate(LIS3DH_DATARATE_LOWPOWER_5KHZ);
// High res off,  BDU enabled
writeRegister8(LIS3DH_REG_CTRL4, 0x80);

Datasheet info

The following is taken directly from page 9 of the Application Note.

Referring to the LIS3DH datasheet, output data rate (ODR) and low power enable (LPen)
bits of CTRL_REG1 and HR bits of CTRL_REG4 are used to select the operating modes
(power-down mode, normal mode and low power mode) and output data rate (Table 2 and
Table 3).

Table 2. Operating mode selection

Operating mode CTRL_REG1[3] (LPen bit) CTRL_REG4[3] (HR bit) BW [Hz] Turn-on time [ms]
Low power mode 1 0 ODR/2 1
Normal mode 0 1 ODR/9 7/ODR

Table 3. Data rate configuration

ODR3 ODR2 ODR1 ODR0 Power mode selection
0 0 0 0 Power-down mode
0 0 0 1 Normal/low power mode (1 Hz)
0 0 1 0 Normal/low power mode (10 Hz)
0 0 1 1 Normal/low power mode (25 Hz)
0 1 0 0 Normal/low power mode (50 Hz)
0 1 0 1 Normal/low power mode (100 Hz)
0 1 1 0 Normal/low power mode (200 Hz)
0 1 1 1 Normal/low power mode (400 Hz)
1 0 0 0 Low power mode (1.5 kHz)
1 0 0 1 Normal (1.250 kHz)/low power mode (5 kHz)

I believe these correlate to the these data rate options in Adafruit_LIS3DH.h.

References

from adafruit_lis3dh.

erichiggins avatar erichiggins commented on August 26, 2024

@ladyada Is this repo still being maintained? There are several open PRs and Issues, like this one, which have not had responses.

from adafruit_lis3dh.

hakeemta avatar hakeemta commented on August 26, 2024

HR bit in LIS3DH_REG_CTRL5

HR bit is in LIS3DH_REG_CTRL4

from adafruit_lis3dh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.