IMU teensy 3.6

Status
Not open for further replies.

Fox95

Active member
I cannot get any reading from the imu using this code below. I can get reading from it from other boards but when i switched to the teensy 3.6 it now will not work any help is much appreciated




#include <Wire.h>

#include "SparkFun_BNO080_Arduino_Library.h"
BNO080 myIMU;

#define BNO_ADDRESS (0x4A) // device address when SA0 Pin 17 = GND; 0x4B SA0 Pin 17 = VDD
#define N_RST (24) // N_RST pin of BNO080
void setup()
{
Serial.begin(115200);
Serial.println();
Serial.println("BNO080 Read Example");

Wire.begin();

myIMU.begin();

//Wire.setClock(400000); //Increase I2C data rate to 400kHz
//---------------------------------------------------------------
digitalWrite(N_RST, LOW); // Reset pulse active low
pinMode(N_RST, OUTPUT);
delay(100); // not clear how long this must be. reset probably not needed at all
digitalWrite(N_RST, HIGH);
//-------------------------------------------------------------------
myIMU.enableAccelerometer(50); //Send data update every 50ms

Serial.println(F("Accelerometer enabled"));
Serial.println(F("Output in form x, y, z, in m/s^2"));

//------------------------------------------------------------------------
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");

delay(200); //needed to accept feature command; minimum not tested
//--------------------------------------------------------------------------
}

void loop()
{
//Look for reports from the IMU
if (myIMU.dataAvailable() == true)
{
float x = myIMU.getAccelX();
float y = myIMU.getAccelY();
float z = myIMU.getAccelZ();

Serial.print(x, 2);
Serial.print(F(","));
Serial.print(y, 2);
Serial.print(F(","));
Serial.print(z, 2);
Serial.print(F(","));

Serial.println();
}
}
 
You mean the setup runs fine and finds the board ("BNO found"), but the main loop never prints anything (so myIMU.dataAvailable() returns false)?
 
nodata.JPG

this is all i get

im using the i2c wiring with 2.2k pu resistors on the sda and scl wires. ive had it working and printing imu values from a adafruit board, but i really need to use the teensy board from here out its a much better platform for me.

this is the imu im using:
View attachment FSM30x-Datasheet.pdf
 
So it does not want to communicate over I2C.

Did the exact same sketch listed above run on other boards? If so, which boards?

I see this line: #define N_RST (24) // N_RST pin of BNO080, shouldn't that be: #define N_RST 24 (without brackets).
I would comment out the 4 reset lines anyway, since they are also not in Sparkfun's example code at [url]https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/master/examples/Example15-RawReadings/Example15-RawReadings.ino[/URL]
Also pinMode(N_RST, OUTPUT); should come before digitalWrite(N_RST, LOW);.

For testing, I would comment out these 4 lines:
Code:
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");

delay(200); //needed to accept feature command; minimum not tested

Did you hookup the board according to this diagram?

Capture.PNG

Both PS0 and PS1 pins should be connected to GND to select I2C communication. PS1 is pulled-up at the FSM30x board.

Paul
 
IMG_1585.jpg

i have PS0 and PS1 conected to ground, and i commented out the lines you suggested and changes. still does prints no values. I commented out the NRST lines but they were necessary for it to work on a adafruit board and different code. I originally only had the PS0 pin grounded when it was working on the adafruit board as well. but as i said above, i added PS1 to ground currently and still does nothing
 
I'm looking at the photo you attached and it looks like there is more electronics attached to the Teensy 3.6 than just the FSM30x board, correct?
For example, on the T3.6, the SDA & SCL wires are white & yellow but on the FSM30x board these wires are orange & green.
If so, could you temporarily remove all the other stuff and just test with the FSm30x board and the Sparkfun example sketch [and post a photo again]?

Paul
 
I'm looking at the photo you attached and it looks like there is more electronics attached to the Teensy 3.6 than just the FSM30x board, correct?
For example, on the T3.6, the SDA & SCL wires are white & yellow but on the FSM30x board these wires are orange & green.
If so, could you temporarily remove all the other stuff and just test with the FSm30x board and the Sparkfun example sketch [and post a photo again]?

Paul

no there's nothing else attached, the wires go from male to female and whatever is out of the pic just loops back around to where its supposed to go.

i re wired with all consistent colors so you can see where they are going to, PS0, PS1 are orange, NRST= blue, power = red, black = gnd, yellow = scl, white = sda.

its not allowing me to upload a pic yet i'll try again in a minute
 
Just found out that the FSM30x board default I2C address is 0x4A [pin SA0 is pulled-down on the board].
The Sparkfun library uses default 0x4B, see [url]https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/master/src/SparkFun_BNO080_Arduino_Library.h[/URL]. You may want to change that to 0x4A [line 42].

For a basic hardware/software test, I would start with the most simple example first: [url]https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/master/examples/Example1-RotationVector/Example1-RotationVector.ino[/URL].

Paul
 
Just found out that the FSM30x board default I2C address is 0x4A [pin SA0 is pulled-down on the board].
The Sparkfun library uses default 0x4B, see [url]https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/master/src/SparkFun_BNO080_Arduino_Library.h[/URL]. You may want to change that to 0x4A [line 42].

For a basic hardware/software test, I would start with the most simple example first: [url]https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/blob/master/examples/Example1-RotationVector/Example1-RotationVector.ino[/URL].

Paul


look above at the code i posted i already changed it to 4A
 
I'm not sure the #define works as intended with the brackets around 0x4A, perhaps try #define BNO_ADDRESS 0x4A ?
And are you sure that
Code:
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");
works OK?

Paul
 
I'm not sure the #define works as intended with the brackets around 0x4A, perhaps try #define BNO_ADDRESS 0x4A ?
And are you sure that
Code:
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");
works OK?

Paul

no, it has always been 0x4A still does not work

tried without the bracketserr.JPG

but now says error BNO not found at "default" address. so it must not be changing the address the 0x4A?
 
I'm not sure the #define works as intended with the brackets around 0x4A, perhaps try #define BNO_ADDRESS 0x4A ?
And are you sure that
Code:
Wire.beginTransmission(BNO_ADDRESS);
while (Wire.endTransmission() != 0); //wait until device is responding (32 kHz XTO running)
Serial.println("BNO found");
works OK?

Paul

so i am finding that when i hook any i2c device to the teensy 3.6 and use the i2c scanner its not finding anything. what am i missing with the 3.6 board that it wont find anything?

EDIT.... I moved to pins 17 and 16 on the teeensy board, and now the scanner will scan for items on i2c but it will not return back anything valid. just says unknown error at 0xxx addresses. it will not find the address of the i2c device connected, but is scanning.
 
Last edited:
Know this is late advice but are you sure you have SDA attached to pin 18 and SCL attached to pin 19? Its a bit hard to tell by the photo you attached. If the scanner is not returning anything 2 things - pwr is not connected correctly or you have SDA/SCL reversed.
 
so i am finding that when i hook any i2c device to the teensy 3.6 and use the i2c scanner its not finding anything. what am i missing with the 3.6 board that it wont find anything?

Strange. I would focus on getting the I2C-scanner to work on pins 19 & 18.
Can you check for waveforms on pins 19 & 18 on the Teensy 3.6 when running the scanner? Also check for waveforms on the I2C pins of the FSm30x board.
For what it's worth: I had bad experiences with the cheapo flywires [a.k.a. Mini-PV or DuPont wires] with the molded round connector housings - pin oxidation, broken wires, etc. I threw them all away and only use flywires with a square housing with crimped connectors.

Paul
 
Strange. I would focus on getting the I2C-scanner to work on pins 19 & 18.
Can you check for waveforms on pins 19 & 18 on the Teensy 3.6 when running the scanner? Also check for waveforms on the I2C pins of the FSm30x board.
For what it's worth: I had bad experiences with the cheapo flywires [a.k.a. Mini-PV or DuPont wires] with the molded round connector housings - pin oxidation, broken wires, etc. I threw them all away and only use flywires with a square housing with crimped connectors.

Paul

i cannot get the 3.6 to find any i2c devices at all, i have moved several i2c devices to the 3.6 that are known to work on other boards and that have internal pull up resistors(adafruit) and they will not show up on the 3.6 on any of the pins for scl sda

is there any type of firmware updates that may be necessary for the 3.6 or known bugs that may solve this problem.
 
I have used the T3.6 with a variety of different i2c devices with out any problem. Right now i am using IDE1.8.12 and TD1.52 (latest version).

Out of curiosity which I2Cscanner are you using PJRC has its own that works well with the Teensies and other boards. A couple of other scanners have issues with Arduino and/or Teensy boards. I can not find a link to the official version but here is the one i am using. You may want to give it a try before you go crazy.
 

Attachments

  • I2Cscanner_PRJC.zip
    2.2 KB · Views: 84
I have used the T3.6 with a variety of different i2c devices with out any problem. Right now i am using IDE1.8.12 and TD1.52 (latest version).

Out of curiosity which I2Cscanner are you using PJRC has its own that works well with the Teensies and other boards. A couple of other scanners have issues with Arduino and/or Teensy boards. I can not find a link to the official version but here is the one i am using. You may want to give it a try before you go crazy.

thanks for that, tried it just now, still nothing. runs through the whole list of addresses and finds nothing.

I checked the i2c board with a scope and it works on a adafruit board out outputs a wave pattern as you'd expect, but when same board is connected to the teensy 3.6 pins 18/19 nothing there is no wave patterns. it does have proper power and ground.
 
Are you doubly sure about your connections:
Device -------- T3.6
Pwr ------------ 3.3v (remember T3.6 is a 3.3v device)
GND ----------- Gnd
SCL ------------ pin 19
SDA ------------ pin 18

Have to ask. Usually when I don't find a device with i2cscanner i just swap the connections for SDA/SCL and it finds it.
 
Are you doubly sure about your connections:
Device -------- T3.6
Pwr ------------ 3.3v (remember T3.6 is a 3.3v device)
GND ----------- Gnd
SCL ------------ pin 19
SDA ------------ pin 18

Have to ask. Usually when I don't find a device with i2cscanner i just swap the connections for SDA/SCL and it finds it.

yes, just like the pics above, 3.3 volt source on (3rd pin down right next to 23) GND and pin 19 and 18
 
Are you doubly sure about your connections:
Device -------- T3.6
Pwr ------------ 3.3v (remember T3.6 is a 3.3v device)
GND ----------- Gnd
SCL ------------ pin 19
SDA ------------ pin 18

Have to ask. Usually when I don't find a device with i2cscanner i just swap the connections for SDA/SCL and it finds it.

I have found the source of problem. thanks for your help. it is working correctly now. there was a issue with the breadboard. so frustrating....
 
ok I am at a total loss here.

I just hooked up my BNO080 sparkfun sensor and ran I2CScanner and go the following results:
Code:
I2C Scanner

Scanning...
Device found at address 0x4B  (ADS1115,TMP102)
done
 
ok I am at a total loss here.

I just hooked up my BNO080 sparkfun sensor and ran I2CScanner and go the following results:
Code:
I2C Scanner

Scanning...
Device found at address 0x4B  (ADS1115,TMP102)
done

it's fixed, im now getting IMU readings.

on to the next set problems LOL..... what do you know about CAN messaging? haha
 
Status
Not open for further replies.
Back
Top