🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    ATOM S3 - Problems writing IMU Registers

    Scheduled Pinned Locked Moved General
    2 Posts 1 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      hriq105
      last edited by

      Hello,

      I'm currently developing a solution for acceleration data extraction with the M5Stack ATOM S3 module which already includes a MPU 6886 IMU sensor. In its datasheet I'm told it is capable of reaching 4 kHz of sampling rate for the accelerometer. However, while trying to change the registers in what I thought would be the correct settings for highest performance in terms of sampling speeds, it always outputs acceleration in the range of +-8 g and with sampling speed of 250Hz. This is true for any register values I write. Thus, I suspect the writing of such registers is being wrongly handled.

      My questions are:

      • Is there any library that handles the writing of these registers without fail?
      • Am I choosing the right register addresses and new values?

      I also add here a portion of my code corresponding of the writing of the IMU registers:

      // Setup for IMU
      void setupIMU() {
          Wire.begin();  
      
          writeRegister(0x6B, 0x09);  // Wake up MPU6886
          delay(10);
      
          writeRegister(0x1C, 0x18);  // Set accelerometer to ±16g   
          delay(10);
      
          writeRegister(0x1D, 0x08);  // Disable Low-Pass Filter (more noise)
          delay(10);
      
          writeRegister(0x6C, 0x07);  // Disable gyroscope
          delay(10);
      
          writeRegister(0x1B, 0x03);  // Set gyroscope configuration (if needed)
          delay(10);
      }
      
      void writeRegister(uint8_t reg, uint8_t value) {
          Wire.beginTransmission(0x68);  // MPU6886 I2C address
          Wire.write(reg);               // Register address
          Wire.write(value);             // Value to write
          Wire.endTransmission();        // End transmission
      }
      
      void setup() {
      
        Serial.begin(115200); // Initialize serial communication at 115200 baud rate
        while (!Serial); // Wait for serial to initialize
      
        M5.begin();
        auto cfg = M5.config();
      
        setupIMU();
      
      }
      
      

      Thank you

      H 1 Reply Last reply Reply Quote 0
      • H Offline
        hriq105 @hriq105
        last edited by

        @hriq105

        I found the answer to my problem of writing on the IMU registers on another post here:

        https://community.m5stack.com/topic/6959/finding-imu-3d-example-code

        However, I'm still having some problems with finding out how to set them up to get the full 4 kHz of acceleration data mentioned in the datasheet. If anyone knows this, please let me know.

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post