I2C Seemingly not working

Status
Not open for further replies.

str-alorman

New member
All;
Thanks for the help in advance, and thanks for providing such a coherent community around the Teensy boards.

So, I've been trying to make I2C work across two Teensy 3.2 boards. I've had sufficient trouble that I currently have it set up ONLY for I2C and will worry about the rest of the hardware when I've solved this roadblock.

Between the boards:

GND -> GND
18 -> 18 -> 3.9k ohm -> 3v3
19 -> 19 -> 3.9k ohm -> 3v3

I'm running the example code from both the stock Wire library and the Teensy specific one and can't get any communications between the boards. A few days ago I could get the examples to work, now not even that. In bone stock config.

The Teensys will happily blink their LEDs and accept firmware flashes. USB serial SEEMS to work fine, so far.
Thoughts on this? Has anyone experienced anything similar?

Many thanks
alex
 
So, I've been trying to make I2C work across two Teensy 3.2 boards.
....
I'm running the example code from both the stock Wire library and the Teensy specific one

I don't understand. It sounds like you're running Teensy's Wire lib on a Teensy 3.2 and Arduino's Wire lib on the other Teensy 3.2. But that's impossible. Arduino's Wire lib doesn't even compile for Teensy 3.2.

When you say "running the example code", could you be more specific about exactly which example code? When I click File > Examples > Wire, there are 7 examples. Presumably you're running 2 of those 7, but which ones? And how are you observing the result? With the Arduino Serial Monitor? On which board?


Thoughts on this? Has anyone experienced anything similar?

Hopefully you can see how much guessworks is involved. So I'm going to guess it's some simple problem, like not having the right COM port selected (don't even know if you're using Windows) or issues getting the right code onto each board (Teensy Loader picks the wrong one if you have both connected), or something similar.

I know running master_reader and slave_sender, or master_writer and slave_receiver works.
 
I don't understand. It sounds like you're running Teensy's Wire lib on a Teensy 3.2 and Arduino's Wire lib on the other Teensy 3.2. But that's impossible. Arduino's Wire lib doesn't even compile for Teensy 3.2.

Sorry, I've run the i2c_t3-9.2 basic_master code paired with the basic_slave code (one on each teensy) - nothing across the serial bus back to the computer. I don't get the "Fail" message outlined in code as a possibility.

I have also tried running the File > Examples > Wire > Master_reader paired with Slave_sender on both teensys. I don't get compiler errors. Should I?

Hopefully you can see how much guessworks is involved. So I'm going to guess it's some simple problem, like not having the right COM port selected (don't even know if you're using Windows) or issues getting the right code onto each board (Teensy Loader picks the wrong one if you have both connected), or something similar.

Yes, apologies, I appreciate the support. I'm running it in Windows 7 using TyQT to manager the two. Seems like each program is going to the right teensy. Serial monitors are working fine on every other bit of code. TyQT is awesome for multiple boards.

Also, Paul;
Thanks for having such a supportive community and all the work you do to make it that way! Kudos!

Thanks
a
 
do you have an I2C device/sensor that you can test? have you tried running the scanner example to see if I2C can "see" the slave teensy?

what version of arduino IDE and teensyduino are you running?

examples > i2c_tc3 > slave
if you are running i2c_t3 slave example, it blinks the LEDs awaiting connection from master. do you have blinking LEDs?

the i2c_t3 master example requires pulling one of several pins LOW to initiate a test.

EDIT: ooops, i have an older version of library. new slave does not blink LEDs, but master does require pulling a pin LOW to initiate a test

you could add Serial.println("master hello"); to setup() in master, and similarly in slave as a quick sanity check

I confirmed latest version of i2c_t3 lib basic master/slave worked for me
i2c.jpg
pulled 12 or 11 low to initiate test
 
Last edited:
I was having intermittent trouble with an i2c EEPROM on a breadboard a while back and the problem might be the hook-up wires that you are using. I have had several hookup wires fail on me for seemingly no reason, causing intermittent, annoying faults.
 
Status
Not open for further replies.
Back
Top