Teensy 4.1 to Teensy 4.1 I2C Not Working.

Infinicus

New member
So I have two Teensy 4.1 and I want them to communicate through I2C. So I used the new and improved wire library recommended in the wire page.
Although, both of the Teensy haven't been able to communicate. No Teensy (as master) can detect the other as slaves. I used the example program from Teensy4 I2C library, the find_slaves one.

The wiring that I used is already like it is supposed to:
SCL to SCL - 18 to 18
SDA to SDA - 19 to 19
Both of the Teensy have their grounds connected.
The slave Teensy is connected to master's VCC.
I used my laptop to power the master Teensy.

What am I doing wrong here?
 
I recently updated the Wire library to support slave mode on Teensy 4. Changes are currently only on github.

https://github.com/PaulStoffregen/Wire

I did test using the Wire library examples master_writer & slave_receiver, and also master_reader & slave_sender. They definitely did work.

During my testing, I used 4.7K pullup resistors. Didn't test without real pullup resistors.
 
I recently updated the Wire library to support slave mode on Teensy 4. Changes are currently only on github.

https://github.com/PaulStoffregen/Wire

I did test using the Wire library examples master_writer & slave_receiver, and also master_reader & slave_sender. They definitely did work.

During my testing, I used 4.7K pullup resistors. Didn't test without real pullup resistors.

I did the same testing as you did, but the results stay the same. I tried using Richard Gemmell's library, but it has the same outcome. Alternatively, I tried connecting both using Serial communication and used the echo example. Though, it resulted in it giving a continuous loop of data

This is the result of Serial communication
TeensySerial.png

This is the result if I use I2C from the master_reader (not readable)
TeensyReader.png
 
So I have two Teensy 4.1 and I want them to communicate through I2C. So I used the new and improved wire library recommended in the wire page.
Although, both of the Teensy haven't been able to communicate. No Teensy (as master) can detect the other as slaves. I used the example program from Teensy4 I2C library, the find_slaves one.

The wiring that I used is already like it is supposed to:
SCL to SCL - 18 to 18
SDA to SDA - 19 to 19
Both of the Teensy have their grounds connected.
The slave Teensy is connected to master's VCC.
I used my laptop to power the master Teensy.

What am I doing wrong here?

You likely need pull-up resistors on each of the SDA and SCL pins for one of the Teensies (or on the wires between them). Teensies don't come with pull-up resistors installed on the I2C bus, but you typically need one set of pull-up resistors on the I2C bus. Most modern devices tend to have pull-up resistors. I believe Paul uses 2.2K resistors for the prop shield, audio shield, etc. that have the resistors installed.

A pull-up resistor is a resistor between the data pin and the power source (3.3v in this case). However, the more resistance on the I2C bus can mean you can't run I2C at higher speeds.

One debug technique is to run the I2C scanner on the Teensy that is acting as the I2C master. If it hangs or doesn't find the slave Teensy, then you might need the pull-up resistors. I also will put a known good I2C device on the bus to see it if finds it with the scanner.

In the past, I think I have burned out the I2C bus on a LC/3.6/4.0/4.1 micro-processor when I connected a 5 volt I2C bus to the Teensy (don't do that).
 
Back
Top