Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 11 of 11

Thread: Wire1 Hangs Teensy 3.2 + MPU9250 add-on

  1. #1
    Junior Member
    Join Date
    Feb 2019
    Posts
    7

    Wire1 Hangs Teensy 3.2 + MPU9250 add-on

    Hello,

    I'm trying to use this device:
    https://www.tindie.com/products/oneh...dd-on-shields/
    on a Teensy 3.2. However, once I got it soldered on in the right spot and uploaded a sketch, I couldn't see the 9dof at all. I tried using Wire1 instead of Wire as the page said, but it seems to just hang at Wire1.begin() if I do so.

    Code I'm using to test:

    Code:
    #include "MPU9250.h"
    
    MPU9250 mpu;
    
    void setup()
    {
        Serial.begin(115200);
    
        Wire1.begin();
        Serial.println("I2C Successful");
    
        delay(2000);
        mpu.setup();
    
        delay(5000);
    
        // calibrate anytime you want to
        mpu.calibrateAccelGyro();
        mpu.calibrateMag();
    
        mpu.printCalibration();
    }
    
    void loop()
    {
    }
    I tried using different mpu9250 libraries and all show the same thing; nothing on Wire1.

    I do have all pads soldered to the back of the Teensy, but the pin 33 doesn't "seem" to be causing issues.

    Does anyone have ideas?

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,419
    Maybe ask the seller?

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,807
    Yes, follow up with onehorse. Did you try his github code and suggestions on readme and wiki? Changing to Wire1 takes a code edit IIRC where the posted code uses WIRE for connecting on the normal pathways of other devices.

  4. #4
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    494
    Also, just my curiosity, but where did you download that MPU9250 library from?

  5. #5
    Junior Member
    Join Date
    Feb 2019
    Posts
    7
    Quote Originally Posted by brtaylor View Post
    Also, just my curiosity, but where did you download that MPU9250 library from?
    Quote Originally Posted by defragster View Post
    Yes, follow up with onehorse. Did you try his github code and suggestions on readme and wiki? Changing to Wire1 takes a code edit IIRC where the posted code uses WIRE for connecting on the normal pathways of other devices.
    I haven't found his wiki, I'll do that today. I figured he had some code somewhere to test already set up with this board.

    I got the mpu9250 library from the arduino library manager, which one I can't remember (on my home computer, I'm at work right now)

  6. #6
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,663
    @GinDiamond

    I don't have this particular OneHorse board but they typically work. Example Sketches and other documentation is linked on his product but page but can be found here: https://github.com/kriswiner/MPU9250.

  7. #7
    Junior Member
    Join Date
    Feb 2019
    Posts
    7
    Quote Originally Posted by mjs513 View Post
    @GinDiamond

    I don't have this particular OneHorse board but they typically work. Example Sketches and other documentation is linked on his product but page but can be found here: https://github.com/kriswiner/MPU9250.
    Interesting. I tried that sketch this morning, and it says that the shield wasn't detected at all (MPU9250 I AM FF I should be 71).

    I think I'll try desoldering the shield and seeing if it works on its own.

  8. #8
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,663
    Quote Originally Posted by GinDiamond View Post
    Interesting. I tried that sketch this morning, and it says that the shield wasn't detected at all (MPU9250 I AM FF I should be 71).

    I think I'll try desoldering the shield and seeing if it works on its own.
    Hang on - before desoldering anything - I ran into that problem before - let me check something.

  9. #9
    Senior Member+
    Join Date
    Jul 2014
    Location
    New York
    Posts
    2,663
    Quote Originally Posted by mjs513 View Post
    Hang on - before desoldering anything - I ran into that problem before - let me check something.
    First check to see if the ADO pin is reading Hi or Low (3.3 or gnd). If it its Hi change:
    Code:
    #define ADO 0
    to
    Code:
    #define ADO 1

  10. #10
    Junior Member
    Join Date
    Feb 2019
    Posts
    7
    Quote Originally Posted by mjs513 View Post
    First check to see if the ADO pin is reading Hi or Low (3.3 or gnd). If it its Hi change:
    Code:
    #define ADO 0
    to
    Code:
    #define ADO 1
    I tried this, however, I still get the same error.

    Code:
    // Using the MPU9250Teensy 3.1 Add-On shield, ADO is set to 0 
    // Seven-bit device address is 110100 for ADO = 0 and 110101 for ADO = 1
    #define ADO 1
    #if ADO
    #define MPU9250_ADDRESS 0x69  // Device address when ADO = 1
    #define AK8963_ADDRESS 0x0C   //  Address of magnetometer
    #define MS5637_ADDRESS 0x76   // Address of altimeter
    #else
    #define MPU9250_ADDRESS 0x68  // Device address when ADO = 0
    #define AK8963_ADDRESS 0x0C   //  Address of magnetometer
    #define MS5637_ADDRESS 0x76   // Address of altimeter
    #endif

  11. #11
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,807
    Unsoldering that would be a bear - and could easily remove those under pads with heat or pressure if pulled.

    It has been some time but I've soldered onehorse underpad MPU's like that to at least one T_3.2 and T_3.6 and found them to work using his code - I've gotten a few+ other boards from onehorse to good effect. The tindie page links to Wiki and code and that is what I used.

    The soldering is critical on those under pads of course so check that for only intended good clean connects. And pay attention to the proper address as @mjs513 notes - then make sure the proper Wire1 bus is in use in the code to get to those bottom pad pin #'s.

    And onehorse is the best source for questions - not sure if you've been in contact with him but I've found him very helpful and responsive … I got on a github stream is seems and my inbox caught 866 messages in the last 8 months with YPR or other questions for working devices.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •