uNav AHRS

Status
Not open for further replies.
Also, version 0_0_7 has FastLED and Wire commented out. So just download from the other thread. I tested it this morning and works like a charm.
 
I pulled and updated to SPI_MST V_0.0.9 and it runs well at 30 MHz. Posted updated Examples there : Project-SPI_MSTransfer

Only change to MPU9250_INS9State_V10_SPI.ino was added SPI_BUS speed param: SPI_MSTransfer teensy_gpio = SPI_MSTransfer("Serial", SPI_MST_CS, SPI_MST_BUS, 30000000);

<edit> changed link to other thread - minor updates for :: examples_V0.0.9b.zip posted there
 
Last edited:
Got it. Geez, I go away for awhile to errands and other things and the world changes. I will download 9 and give it a try.
 
Don - Tim

Attached is version 11. It has been updated to work with SPI library at version 0_0_9. It also makes some changes to the configDefines as Tim proposed in the other thread &SPI went to SPI :) See I do read the threads sometimes :)

Cheers
Mike
 

Attachments

  • MPU9250_INS9State_V11_SPI.zip
    40.4 KB · Views: 66
By the way I just updated the examples :) Link updated above

Got it. Geez, I go away for awhile to errands and other things and the world changes. I will download 9 and give it a try.

Definitely have to do that - errands an things. Time to make lunch ...
 
Thanks Tim - those were the examples I used. EDIT - NOPE, I used the previous examples.

Don - you will need to edit the defines for your t3.6-t3.6 configuration
 
Mike,
Tried V10 and its failing the compile on line 76:

MPU9250 Imu(IMU_BUS, IMU_ADDR, IMU_SCL, IMU_SDA, IMU_SPD)

with error message:

no matching function call, expects 2 arguments, 5 received

Did you modify the MPU9250 library? wondering if I'm a version behind...

Just saw you have a V11, will try that now...
 
Just finished diner.

Yes, I did modify the MPU9250 library so if we are using the teensy we can use the i2c_t3 library. If you look at version 10 and version 11 "MPU9250 Imu(IMU_BUS, IMU_ADDR, IMU_SCL, IMU_SDA, IMU_SPD)" is wrapped in an ifdef for the teensy (I used TEENSYDUINO) and if not it will use the normal Wire library.

Tim already pointed out the post - he beat me to it :). Version 11 is setup to use the new version of the SPI_MSTrasfer library. Just remember to update your SPI config in A_configDefines and change the define to your profile - can't tell you how many times that bit me :)
 
Don - Tim

I just noticed a change that should be made. In lieu of this can you all just change lines 319-322 in the main ino to:
Code:
  #ifdef SPI_MST_SCK
    SPI_MST_BUS.setSCK( SPI_MST_SCK );
  #endif
    SPI_MST_BUS.begin();

its in the void SPI_MST_init() function.

Thanks
Mike
 
Tim,
Looked at the link you sent, and I see where the mods to V10 (and V11) were made, but I'm not seeing what lines are changed in the MPU9250 library itself. Is there a revised MPU9250.cpp and .h file somewhere that I'm missing?

Can't keep up with you two. You guys are fast! I'm still a relative beginner on some of this hardware stuff!

Don
 
Don

Here is another copy of the zip just in case. Do a search for TEENSYDUINO [edit] and you should see the changes.

Mike
 

Attachments

  • MPU9250.zip
    28.5 KB · Views: 76
Don - Tim

I just noticed a change that should be made. In lieu of this can you all just change lines 319-322 in the main ino to:
Code:
  #ifdef SPI_MST_SCK
    SPI_MST_BUS.setSCK( SPI_MST_SCK );
  #endif
    SPI_MST_BUS.begin();

its in the void SPI_MST_init() function.

Thanks
Mike

Yeah - I did that while Tony and I chatted - should have been in 2nd post? I broke my version - going back to that now.
 
Been running the INS sketch for awhile at full bore: I2C bus at 1000000, printrate=1 and 200Hz update rate. I turned on the debug for the master as well. I have had 1 "DEBUG: [SLAVE CS 15] [INFO] PACKET AUTO RESENT" after 3000 records. But of course that is also with a the delay set at 1microsecond in the .h file.
 
Restored from the examples_V0.0.9b.zip and SPI_MSTransfer 0_0_9.zip and the examples are running again - tried to hack in a count to track lost F&F data messages and failed.

Tony couldn't get examples to run as posted as he uses SPI2 - so I changed the #defines in the CONFIG.h to account for that by removing the "&" in #define and apply it where needed and that worked for the change noted in p#761. Was nice to avoid adding a 2nd parallel #define.
 
@rwalters. Thanks for the references will have to look at them more closely. Took a quick look and pretty interesting the flybrix. Didn't even know about that.

Mike
 
Tim-Don
Tested with v0_0_10 of the SPI_MSTransfer library (latest version) and it no issues. No changes are required to our INS sketch or the slave sketch.

Mike
 
Mike,

I'm still trying to get V11 working. I installed your modified MPU9250 cpp and h files, but now I'm getting this message during compile. my pin assignments in the Defines tab look ok to me. Any suggestions? Thx!!

*******************************************

C:\Users\User\Documents\Arduino\libraries\MPU9250-master\MPU9250.cpp:73:53: error: invalid conversion from 'uint8_t {aka unsigned char}' to 'i2c_pins' [-fpermissive]

_i2c->begin(I2C_MASTER, _address, _pinSCL, _pinSDA, _pullups, _i2cRate);

^

In file included from C:\Users\User\Documents\Arduino\libraries\MPU9250-master\MPU9250.h:31:0,

from C:\Users\User\Documents\Arduino\libraries\MPU9250-master\MPU9250.cpp:25:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\i2c_t3/i2c_t3.h:589:17: note: initializing argument 4 of 'void i2c_t3::begin(i2c_mode, uint8_t, uint8_t, i2c_pins, i2c_pullup, uint32_t, i2c_op_mode)'

inline void begin(i2c_mode mode, uint8_t address1, uint8_t address2, i2c_pins pins, i2c_pullup pullup, uint32_t rate, i2c_op_mode opMode=I2C_OP_MODE_ISR)

^

C:\Users\User\Documents\Arduino\libraries\MPU9250-master\MPU9250.cpp: In member function 'int MPU9250::calGyroFast(int)':
 
#elif defined(DK)
//--------------------------------------------------------------------
//---- GPS Declares
//--------------------------------------------------------------------
#define HAS_GPS 1
#ifdef HAS_GPS
#define GPS_Start 3 // 1 // UBLOX gps(gps_Start);
#define GPS_PORT Serial3 // Serial1
#define GPS_BAUD 115200
#define GPS_SRX 7 //27 //9 // Must be set to Serial# Rx Pin #
#define GPS_AltRx 255 // 27
#endif

//--------------------------------------------------------------------
// IMU Declares
//--------------------------------------------------------------------
#define IMU_BUS Wire //Wire // SPI
#define IMU_ADDR 0x68 //0x69 // 0x68 // SPI 9
#define IMU_SCL 19 //47 // 0x255
#define IMU_SDA 18 //48 // 0x255
#define IMU_SPD 400000 //1000000 // 0==NULL or other
#define IMU_SRD 9 // Used in initIMU setSRD() - setting SRD to 9 for a 100 Hz update rate
#define IMU_INT_PIN 1 //50 // 1 // 14

//--------------------------------------------------------------------
//Set print rate, sincePrint > printRate
//--------------------------------------------------------------------
#define printRate 25 //milliseconds

//--------------------------------------------------------------------
// Serial Declares
//--------------------------------------------------------------------
#define cout Serial
#define cout_BAUD 115200
#define coutD Serial2 //Serial4 // Serial2
#define coutD_BAUD 2000000 // coutD for DEBUG port
 
Don

Just remembered, senility is setting in, I had the same issue - go to GITHUB, https://github.com/nox771/i2c_t3, and pull down the latest version of i2c_t3. My version was outdated and got the same problem. The version I had didn't have the ability to assign the pins individually.
 
roger that, thanks!

off to music gig, will do that when I get back later tonight after the gig. thx for the hint!!
 
Status
Not open for further replies.
Back
Top