Hello,
I am working on a project that uses the SDA2 and SCL2 pins on the Teensy 4.1. I've read a lot of forum posts where people have apparently been able to do this, as long as they make use of Wire2 instead of Wire with the Wire.h library. I am still having trouble though. I can't get the I2C writes to work on Wire2. I'm using Platform IO with arduino framework. Here is what I know:
How are people having success if i2c_t3 is not for the 4.x devices?
I'm not sure what to provide, since it doesn't seem like this is a problem with my code (works correctly on Wire). It seems like my knowledge on setting up a project properly in platform IO may be limiting here?
Thanks,
I am working on a project that uses the SDA2 and SCL2 pins on the Teensy 4.1. I've read a lot of forum posts where people have apparently been able to do this, as long as they make use of Wire2 instead of Wire with the Wire.h library. I am still having trouble though. I can't get the I2C writes to work on Wire2. I'm using Platform IO with arduino framework. Here is what I know:
- When I use Wire (pins 18/19) I can see the I2C writes on the pins correctly with a scope.
- When I use Wire2 (pins 24/25), I don't see the writes, in fact pin 25 is output low while 24 is constant 3.3V. Still compiles though.
- When I right click and go to definition on Wire2, it takes me to i2c_t3.cpp, which I can google and see that this is not meant for teensy4 and higher.
- Yes, I have pull up resistors on my I2C bus in both cases
How are people having success if i2c_t3 is not for the 4.x devices?
I'm not sure what to provide, since it doesn't seem like this is a problem with my code (works correctly on Wire). It seems like my knowledge on setting up a project properly in platform IO may be limiting here?
Thanks,
Code:
#include <Arduino.h>
#include <Wire.h>
// Hardware Pins
#define SDA 25 // I2C
#define SCL 24
void setup()
{
Wire2.begin();
Serial.begin(9600);
}
void loop()
{
Wire2.beginTransmission(0b1100100);
Wire2.write(0b00001111);
Wire2.write(0b11111100);
Wire2.endTransmission();
delay(1000);
}