Trying to set another I2C pinout with Teensy 4X,but fails [SOLVED]

AntiLoop

Active member
Hello,everybody

After done the settings of my buydisplay ra8875 i2c touch,successfully with teensy 4.1,no conflicts at all with sdcard or I2s,all play smoothly,
I decided to do it again with teensy 4X and audioboard rev D,but now the problems occur because on the audioboard,
the pins 18 & 19 are dedicated to audio control and i can't use the default i2c wire sda,scl,because conflicts,the sdcard doesn't play audio,
so i red on the forum the method to use another i2c pinout and verify this work,with the i2c scanner sketch beginnig:

Code:
#include <Wire.h>


void setup() {

  // uncomment these to use alternate pins


  pinMode(16,INPUT_PULLUP);

  pinMode(17,INPUT_PULLUP);

 

  Wire1.setSCL(16);

  Wire1.setSDA(17);

  Wire1.begin();

 

  Serial.begin(9600);


...and so on...

but nothing is found 💀
when i do it with the default wiring i found an address 0x38,i think the i2c of my ra8875 has pullup resistors inside because
it works allright.

Does someone succeed with the audioboard and i2c touch,or succeed with another i2c pinout on teensy 4x??
 
Below is the combo that I've used successfully on a couple of projects that combine the T4.x + Audio Adapter Rev D + RA8875 display:

Code:
//
// The following pins are used in this project:
//
// PIN D0       = MIDI DIN RX
// PIN D1       = MIDI DIN TX
// PIN D2       = RA8875 Touchscreen INT
// PIN D3       = RA8875 Touchscreen RESET
// PIN D4       = CHECK_BATTERY_PIN
// PIN D5       = (not used)
// PIN D6       = Audio adapter memory chip select (MEMCS)
// PIN D7       = Audio adapter data in (DIN)
// PIN D8       = Audio adapter data out (DOUT)
// PIN D9       = (not used)
// PIN D10      = Audio adapter SD card chip select (SDCS)
// PIN D11      = Audio adapter SPI data in (MOSI)
// PIN D12      = Audio adapter SPI data out (MISO)
// PIN D13      = Audio adapter SPI serial clock (SCK) + on-board LED
// PIN D14/A0   = (not used)
// PIN D15/A1   = Volume pot on audio adapter (not used)
// PIN D16/A2   = (not used)
// PIN D17/A3   = (not used)
// PIN D18/A4   = Audio adapter I2C control data (SDA)
// PIN D19/A5   = Audio adapter I2C control clock (SCL)
// PIN D20/A6   = Audio adapter Left/Right Clock (LRCLK)
// PIN D21/A7   = Audio adapter Bit Clock (BCLK)
// PIN D22/A8   = (not used)
// PIN D23/A9   = Audio adapter Master Clock (MCLK)
// PIN D23/A9   = (not used)
// PIN D24/A10  = (not used)
// PIN D25/A11  = (not used)
// PIN D26/A12  = RA8875 Touchscreen MOSI (MOSI1)
// PIN D27/A13  = RA8875 Touchscreen SCLK (SCK1)
// PIN D28      = (not used)
// PIN D29      = (not used)
// PIN D30      = (not used)
// PIN D31      = (not used)
// PIN D32      = (not used)
// PIN D33      = (not used)
// PIN D34      = (not used)
// PIN D35      = (not used)
// PIN D36      = (not used)
// PIN D37      = (not used)
// PIN D38/A14  = RA8875 Touchscreen CS (CS1)
// PIN D39/A15  = RA8875 Touchscreen MISO (MISO1)
// PIN D40/A16  = (not used)
// PIN D41/A17  = (not used)

Definitions for the T4.x to RA8875 display connections are as follows:

Code:
// when used w/ Audio Adapter, must use an alternate CS pin for the display
const int RA8875_CHIP_SELECT     =  38;       // Teensy 38 (A14) -to- RA8875 05
const int RA8875_RESET           =   3;       // Teensy 03 (D03) -to -RA8875 11
const int RA8875_MISO            =  39;       // Teensy 39 (A15) -to- RA8875 06
const int RA8875_MOSI            =  26;       // Teensy 26 (A12) -to- RA8875 07
const int RA8875_SCLK            =  27;       // Teensy 27 (A13) -to- RA8875 08
const int RA8875_TS_INT          =   2;       // Teensy 02 (D02) -to- RA8875 33

const int RA8875_MAX_TOUCH_LIMIT =   1;

RA8875 tft = RA8875(RA8875_CHIP_SELECT, RA8875_RESET, RA8875_MOSI, RA8875_SCLK, RA8875_MISO);

Initialization for RA8875 display in setup() function:

Code:
   pinMode(RA8875_CHIP_SELECT, OUTPUT);
   digitalWrite(RA8875_CHIP_SELECT, HIGH);

   pinMode(RA8875_RESET, OUTPUT);
   digitalWrite(RA8875_RESET, LOW);

   check_time = millis();
   while ((millis() - check_time) <= 100);

   digitalWrite(RA8875_RESET, HIGH);

   Serial.begin(57600);

   check_time = millis();
   while (!Serial && !EAserial && ((millis() - check_time) <= 2000));

   if (CrashReport) {
      Serial.print(CrashReport);
   }

   tft.begin(RA8875_800x480);

   tft.DMA_enable();

   tft.setRotation(0);

   tft.clearScreen();

#ifdef DISABLE_BACKLIGHT_CONTROL
   mainBacklightSlider.value = 255;
#endif

   tft.brightness(mainBacklightSlider.value);

#ifdef USE_RA8875_TOUCH
   tft.useINT(RA8875_TS_INT);      // use generic int helper for Internal Resistive Touch
   tft.touchBegin();               // enable touch support for RA8875
#else
   tft.useCapINT(RA8875_TS_INT);   // use the FT5206 chip interrupt
#endif

   tft.setTouchLimit(RA8875_MAX_TOUCH_LIMIT);

#ifdef USE_RA8875_TOUCH
   tft.enableISR(true);
#else
   tft.enableCapISR(true);         // capacitive touch screen interrupt it's armed
#endif

   tft.writeTo(L1);                // write to layer 1
   tft.layerEffect(OR);            // apply OR between layer 1 and 2

Initialization for the Audio Adapter is typical/standard;

Hope that helps . . .

Mark J Culross
KD5RXT
 
Hello,everybody

After done the settings of my buydisplay ra8875 i2c touch,successfully with teensy 4.1,no conflicts at all with sdcard or I2s,all play smoothly,
I decided to do it again with teensy 4X and audioboard rev D,but now the problems occur because on the audioboard,
the pins 18 & 19 are dedicated to audio control and i can't use the default i2c wire sda,scl,because conflicts,the sdcard doesn't play audio,
so i red on the forum the method to use another i2c pinout and verify this work,with the i2c scanner sketch beginnig:
Ummm, you should be able to use I2C with pins 18/19 with the audio board, as long as you don't use a device that uses the 2 addresses: 0x0a for the SGTL5000 and 0x1a for the WM8731 that the audio board uses. I know I've used other I2C devices with the audio board. I2C is a shared bus, where each device has an address and when the host and device talk, the conversation uses the client I2C address.

I could imagine that if your device tries to set the I2C bus speed, it might be different in having 2 devices on the same bus, but this is just a guess. In that case, you might need to use either I2C1 (pins 17 for SDA1 and pin 16 for SCL1) or I2C2 (pin 25 for SDA2 and pin 24 for SCL2). It is possible, if you use I2C1 or I2C2 that you will need to add pull-up resistors. You don't need to do this on the default I2C, because the audio board provides the pull-up resistors. A pull-up resistor is typically 2 2.2K resistors, one connected between the SDA pin and 3.3v and the between the SCL pin and 3.3v. Many devices these days, have pull-up resistors, but if your device doesn't, you will need at least one set of pull-up resistors on the I2C bus.
 
Last edited:
Hi to all,

to -> kd5rxt-mark,
thank you for your infos and advices,but nothing works,i even tried a ft5206 touch test with your pinout and even
declare SPI1 in the setup,because you use those pins:
SPI1.setCS(38);
SPI1.setMISO(39);
SPI1.setMOSI(26);
SPI1.setSCK(27);
SPI1.begin();
But really nothing happens ... :(

to -> MichaelMeissner,
I believe you're right because i had a nice experience with teenst 4.1 and adafruit FT6206 ,but without using the audioboard.
As you said, I2C modules sold on the market today are incorporing pullup resistances,i don't think my problem
is from that source,while i will try later a pullup resistances network if nothing responds

please give me a I2C setup that will work,do i need to enter an adress like Wire.begin(0x38) to make a difference
with the audioboard?
 
@AntiLoop:

Which exact display do you have ?? Does it really have the FT5206 touch controller on it ?? How do you have it wired ??

Without specific info (& maybe pictures as well), anything more here is just a best guess !!

Looking to help, if at all possible . . .

Mark J Culross
KD5RXT
 
@kd5rxt-mark:

I have a buydisplay ER-TFTM070-7,i use 4 wire SPI and I2C for the touch
I couldn't make the touch working with FT5206,so i tried the adafruit FT6206 with success.

Now i just solved my problem with a teensy 4.1 and audioboard,everything works perfect,with this pinout:

I2C TOUCH:
SERIAL MODE:
RA8875->1~2->TEENSY 4.1 VSS (GND)
RA8875->3~4->VDD (3,3V)
RA8875->5->SCS-CS->36
RA8875->6->SDO-MISO->12
RA8875->7->SDI-MOSI->11
RA8875->8->SCLK-SCK->13
RA8875->10-> INT ->2
RA8875->11-> RST ->255
RA8875->14-> BL CONTROL(NC)

I2C TOUCH:
RA8875->34->SDA->18
RA8875->33->SCL->19

I just realised the problem was from the CS pin i used for the RA8875,that made a conflict with the
audioboard sdcard: 10,so i change it to 36.

But i still can't change the I2C pinout like i want to,it doesn't matter anymore...
I would like to thank all the helpers :)
 
Here i made a try with a simple lcd (0x27) and that works with the default pinout (18,19)
but fails with (17,16), with a teensy 4.0 and teensyduino 1.59-beta3.
My code:

Code:
#include <Wire.h>


#define SDA_PIN 17
#define SCL_PIN 16

void setup() {
  // uncomment these to use alternate pins
  pinMode(SCL_PIN,INPUT_PULLUP);
  pinMode(SDA_PIN,INPUT_PULLUP);
  Wire1.setSCL(SCL_PIN);
  Wire1.setSDA(SDA_PIN);
  Wire1.begin();
 
  Serial.begin(9600);
  while (!Serial);        // Leonardo: wait for serial monitor
  Serial.println(F("\nI2C Scanner"));
}


void loop() {
  byte error, address;
  int nDevices;

  Serial.println(F("Scanning..."));

  nDevices = 0;
  for (address = 1; address < 127; address++) {
    // The i2c_scanner uses the return value of
    // the Write.endTransmisstion to see if
    // a device did acknowledge to the address.
    Wire.beginTransmission(address);
    error = Wire.endTransmission();

    if (error == 0) {
      Serial.print(F("Device found at address 0x"));
      if (address < 16) {
        Serial.print("0");
      }
      Serial.print(address,HEX);
      Serial.print("  (");
      printKnownChips(address);
      Serial.println(")");

      nDevices++;
    } else if (error==4) {
      Serial.print(F("Unknown error at address 0x"));
      if (address < 16) {
        Serial.print("0");
      }
      Serial.println(address,HEX);
    }
  }
  if (nDevices == 0) {
    Serial.println(F("No I2C devices found\n"));
  } else {
    Serial.println(F("done\n"));
  }
  delay(5000);           // wait 5 seconds for next scan
}


void printKnownChips(byte address)
{
  // Is this list missing part numbers for chips you use?
  // Please suggest additions here:
  // https://github.com/PaulStoffregen/Wire/issues/new
  switch (address) {
    case 0x00: Serial.print(F("AS3935")); break;
    case 0x01: Serial.print(F("AS3935")); break;
    case 0x02: Serial.print(F("AS3935")); break;
    case 0x03: Serial.print(F("AS3935")); break;
    case 0x04: Serial.print(F("ADAU1966")); break;
    case 0x0A: Serial.print(F("SGTL5000")); break; // MCLK required
    case 0x0B: Serial.print(F("SMBusBattery?")); break;
    case 0x0C: Serial.print(F("AK8963")); break;
    case 0x10: Serial.print(F("CS4272")); break;
    case 0x11: Serial.print(F("Si4713")); break;
    case 0x13: Serial.print(F("VCNL4000,AK4558")); break;
    case 0x18: Serial.print(F("LIS331DLH")); break;
    case 0x19: Serial.print(F("LSM303,LIS331DLH")); break;
    case 0x1A: Serial.print(F("WM8731")); break;
    case 0x1C: Serial.print(F("LIS3MDL")); break;
    case 0x1D: Serial.print(F("LSM303D,LSM9DS0,ADXL345,MMA7455L,LSM9DS1,LIS3DSH")); break;
    case 0x1E: Serial.print(F("LSM303D,HMC5883L,FXOS8700,LIS3DSH")); break;
    case 0x20: Serial.print(F("MCP23017,MCP23008,PCF8574,FXAS21002,SoilMoisture")); break;
    case 0x21: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x22: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x23: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x24: Serial.print(F("MCP23017,MCP23008,PCF8574,ADAU1966,HM01B0")); break;
    case 0x25: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x26: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x27: Serial.print(F("MCP23017,MCP23008,PCF8574,LCD16x2,DigoleDisplay")); break;
    case 0x28: Serial.print(F("BNO055,EM7180,CAP1188")); break;
    case 0x29: Serial.print(F("TSL2561,VL6180,TSL2561,TSL2591,BNO055,CAP1188")); break;
    case 0x2A: Serial.print(F("SGTL5000,CAP1188")); break;
    case 0x2B: Serial.print(F("CAP1188")); break;
    case 0x2C: Serial.print(F("MCP44XX ePot")); break;
    case 0x2D: Serial.print(F("MCP44XX ePot")); break;
    case 0x2E: Serial.print(F("MCP44XX ePot")); break;
    case 0x2F: Serial.print(F("MCP44XX ePot")); break;
    case 0x30: Serial.print(F("Si7210")); break;
    case 0x31: Serial.print(F("Si7210")); break;
    case 0x32: Serial.print(F("Si7210")); break;
    case 0x33: Serial.print(F("MAX11614,MAX11615,Si7210,MLX90640,MLX90641")); break;
    case 0x34: Serial.print(F("MAX11612,MAX11613")); break;
    case 0x35: Serial.print(F("MAX11616,MAX11617")); break;
    case 0x38: Serial.print(F("RA8875,FT6206,MAX98390")); break;
    case 0x39: Serial.print(F("TSL2561, APDS9960")); break;
    case 0x3A: Serial.print(F("MLX90632")); break;
    case 0x3C: Serial.print(F("SSD1306,DigisparkOLED")); break;
    case 0x3D: Serial.print(F("SSD1306")); break;
    case 0x40: Serial.print(F("PCA9685,Si7021,MS8607")); break;
    case 0x41: Serial.print(F("STMPE610,PCA9685")); break;
    case 0x42: Serial.print(F("PCA9685")); break;
    case 0x43: Serial.print(F("PCA9685")); break;
    case 0x44: Serial.print(F("PCA9685, SHT3X, ADAU1966")); break;
    case 0x45: Serial.print(F("PCA9685, SHT3X")); break;
    case 0x46: Serial.print(F("PCA9685")); break;
    case 0x47: Serial.print(F("PCA9685")); break;
    case 0x48: Serial.print(F("ADS1115,PN532,TMP102,LM75,PCF8591,CS42448")); break;
    case 0x49: Serial.print(F("ADS1115,TSL2561,PCF8591,CS42448,TC74A1")); break;
    case 0x4A: Serial.print(F("ADS1115,Qwiic Keypad,CS42448")); break;
    case 0x4B: Serial.print(F("ADS1115,TMP102,BNO080,Qwiic Keypad,CS42448")); break;
    case 0x50: Serial.print(F("EEPROM,FRAM")); break;
    case 0x51: Serial.print(F("EEPROM")); break;
    case 0x52: Serial.print(F("Nunchuk,EEPROM")); break;
    case 0x53: Serial.print(F("ADXL345,EEPROM")); break;
    case 0x54: Serial.print(F("EEPROM")); break;
    case 0x55: Serial.print(F("EEPROM")); break;
    case 0x56: Serial.print(F("EEPROM")); break;
    case 0x57: Serial.print(F("EEPROM")); break;
    case 0x58: Serial.print(F("TPA2016,MAX21100")); break;
    case 0x5A: Serial.print(F("MPR121,MLX90614")); break;
    case 0x60: Serial.print(F("MPL3115,MCP4725,MCP4728,TEA5767,Si5351")); break;
    case 0x61: Serial.print(F("MCP4725,AtlasEzoDO")); break;
    case 0x62: Serial.print(F("LidarLite,MCP4725,AtlasEzoORP")); break;
    case 0x63: Serial.print(F("MCP4725,AtlasEzoPH")); break;
    case 0x64: Serial.print(F("AtlasEzoEC, ADAU1966")); break;
    case 0x66: Serial.print(F("AtlasEzoRTD")); break;
    case 0x68: Serial.print(F("DS1307,DS3231,MPU6050,MPU9050,MPU9250,ITG3200,ITG3701,LSM9DS0,L3G4200D")); break;
    case 0x69: Serial.print(F("MPU6050,MPU9050,MPU9250,ITG3701,L3G4200D")); break;
    case 0x6A: Serial.print(F("LSM9DS1")); break;
    case 0x6B: Serial.print(F("LSM9DS0")); break;
    case 0x6F: Serial.print(F("Qwiic Button")); break;
    case 0x70: Serial.print(F("HT16K33,TCA9548A")); break;
    case 0x71: Serial.print(F("SFE7SEG,HT16K33")); break;
    case 0x72: Serial.print(F("HT16K33")); break;
    case 0x73: Serial.print(F("HT16K33")); break;
    case 0x76: Serial.print(F("MS5607,MS5611,MS5637,BMP280")); break;
    case 0x77: Serial.print(F("BMP085,BMA180,BMP280,MS5611")); break;
    case 0x7C: Serial.print(F("FRAM_ID")); break;
    default: Serial.print(F("unknown chip"));
  }
}
 
Last edited:
Code:
#include <Wire.h>


//#define SDA_PIN 17    NOT NEEDED
//#define SCL_PIN 16    NOT NEEDED

void setup() {
    // uncomment these to use alternate pins
//    pinMode(SCL_PIN, INPUT_PULLUP);    NOT NEEDED
//    pinMode(SDA_PIN, INPUT_PULLUP);    NOT NEEDED
//    Wire1.setSCL(SCL_PIN);             NOT NEEDED
//    Wire1.setSDA(SDA_PIN);             NOT NEEDED
    Wire1.begin();

    Serial.begin(9600);
    while (!Serial && (millis() < 5000));        // Leonardo: wait for serial monitor
    Serial.println(F("\nI2C Scanner"));
}


void loop() {
    byte error, address;
    int nDevices;

    Serial.println(F("Scanning..."));

    nDevices = 0;
    for (address = 1; address < 127; address++) {
        // The i2c_scanner uses the return value of
        // the Write.endTransmisstion to see if
        // a device did acknowledge to the address.
        Wire1.beginTransmission(address);        // SHOULD BE Wire1 NOT Wire
        error = Wire1.endTransmission();         // SHOULD BE Wire1 NOT Wire

        if (error == 0) {
            Serial.print(F("Device found at address 0x"));
            if (address < 16) {
                Serial.print("0");
            }
            Serial.print(address, HEX);
            Serial.print("  (");
            printKnownChips(address);
            Serial.println(")");

            nDevices++;
        }
        else if (error == 4) {
            Serial.print(F("Unknown error at address 0x"));
            if (address < 16) {
                Serial.print("0");
            }
            Serial.println(address, HEX);
        }
    }
    if (nDevices == 0) {
        Serial.println(F("No I2C devices found\n"));
    }
    else {
        Serial.println(F("done\n"));
    }
    delay(5000);           // wait 5 seconds for next scan
}


void printKnownChips(byte address)
{
    // Is this list missing part numbers for chips you use?
    // Please suggest additions here:
    // https://github.com/PaulStoffregen/Wire/issues/new
    switch (address) {
    case 0x00: Serial.print(F("AS3935")); break;
    case 0x01: Serial.print(F("AS3935")); break;
    case 0x02: Serial.print(F("AS3935")); break;
    case 0x03: Serial.print(F("AS3935")); break;
    case 0x04: Serial.print(F("ADAU1966")); break;
    case 0x0A: Serial.print(F("SGTL5000")); break; // MCLK required
    case 0x0B: Serial.print(F("SMBusBattery?")); break;
    case 0x0C: Serial.print(F("AK8963")); break;
    case 0x10: Serial.print(F("CS4272")); break;
    case 0x11: Serial.print(F("Si4713")); break;
    case 0x13: Serial.print(F("VCNL4000,AK4558")); break;
    case 0x18: Serial.print(F("LIS331DLH")); break;
    case 0x19: Serial.print(F("LSM303,LIS331DLH")); break;
    case 0x1A: Serial.print(F("WM8731")); break;
    case 0x1C: Serial.print(F("LIS3MDL")); break;
    case 0x1D: Serial.print(F("LSM303D,LSM9DS0,ADXL345,MMA7455L,LSM9DS1,LIS3DSH")); break;
    case 0x1E: Serial.print(F("LSM303D,HMC5883L,FXOS8700,LIS3DSH")); break;
    case 0x20: Serial.print(F("MCP23017,MCP23008,PCF8574,FXAS21002,SoilMoisture")); break;
    case 0x21: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x22: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x23: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x24: Serial.print(F("MCP23017,MCP23008,PCF8574,ADAU1966,HM01B0")); break;
    case 0x25: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x26: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x27: Serial.print(F("MCP23017,MCP23008,PCF8574,LCD16x2,DigoleDisplay")); break;
    case 0x28: Serial.print(F("BNO055,EM7180,CAP1188")); break;
    case 0x29: Serial.print(F("TSL2561,VL6180,TSL2561,TSL2591,BNO055,CAP1188")); break;
    case 0x2A: Serial.print(F("SGTL5000,CAP1188")); break;
    case 0x2B: Serial.print(F("CAP1188")); break;
    case 0x2C: Serial.print(F("MCP44XX ePot")); break;
    case 0x2D: Serial.print(F("MCP44XX ePot")); break;
    case 0x2E: Serial.print(F("MCP44XX ePot")); break;
    case 0x2F: Serial.print(F("MCP44XX ePot")); break;
    case 0x30: Serial.print(F("Si7210")); break;
    case 0x31: Serial.print(F("Si7210")); break;
    case 0x32: Serial.print(F("Si7210")); break;
    case 0x33: Serial.print(F("MAX11614,MAX11615,Si7210,MLX90640,MLX90641")); break;
    case 0x34: Serial.print(F("MAX11612,MAX11613")); break;
    case 0x35: Serial.print(F("MAX11616,MAX11617")); break;
    case 0x38: Serial.print(F("RA8875,FT6206,MAX98390")); break;
    case 0x39: Serial.print(F("TSL2561, APDS9960")); break;
    case 0x3A: Serial.print(F("MLX90632")); break;
    case 0x3C: Serial.print(F("SSD1306,DigisparkOLED")); break;
    case 0x3D: Serial.print(F("SSD1306")); break;
    case 0x40: Serial.print(F("PCA9685,Si7021,MS8607")); break;
    case 0x41: Serial.print(F("STMPE610,PCA9685")); break;
    case 0x42: Serial.print(F("PCA9685")); break;
    case 0x43: Serial.print(F("PCA9685")); break;
    case 0x44: Serial.print(F("PCA9685, SHT3X, ADAU1966")); break;
    case 0x45: Serial.print(F("PCA9685, SHT3X")); break;
    case 0x46: Serial.print(F("PCA9685")); break;
    case 0x47: Serial.print(F("PCA9685")); break;
    case 0x48: Serial.print(F("ADS1115,PN532,TMP102,LM75,PCF8591,CS42448")); break;
    case 0x49: Serial.print(F("ADS1115,TSL2561,PCF8591,CS42448,TC74A1")); break;
    case 0x4A: Serial.print(F("ADS1115,Qwiic Keypad,CS42448")); break;
    case 0x4B: Serial.print(F("ADS1115,TMP102,BNO080,Qwiic Keypad,CS42448")); break;
    case 0x50: Serial.print(F("EEPROM,FRAM")); break;
    case 0x51: Serial.print(F("EEPROM")); break;
    case 0x52: Serial.print(F("Nunchuk,EEPROM")); break;
    case 0x53: Serial.print(F("ADXL345,EEPROM")); break;
    case 0x54: Serial.print(F("EEPROM")); break;
    case 0x55: Serial.print(F("EEPROM")); break;
    case 0x56: Serial.print(F("EEPROM")); break;
    case 0x57: Serial.print(F("EEPROM")); break;
    case 0x58: Serial.print(F("TPA2016,MAX21100")); break;
    case 0x5A: Serial.print(F("MPR121,MLX90614")); break;
    case 0x60: Serial.print(F("MPL3115,MCP4725,MCP4728,TEA5767,Si5351")); break;
    case 0x61: Serial.print(F("MCP4725,AtlasEzoDO")); break;
    case 0x62: Serial.print(F("LidarLite,MCP4725,AtlasEzoORP")); break;
    case 0x63: Serial.print(F("MCP4725,AtlasEzoPH")); break;
    case 0x64: Serial.print(F("AtlasEzoEC, ADAU1966")); break;
    case 0x66: Serial.print(F("AtlasEzoRTD")); break;
    case 0x68: Serial.print(F("DS1307,DS3231,MPU6050,MPU9050,MPU9250,ITG3200,ITG3701,LSM9DS0,L3G4200D")); break;
    case 0x69: Serial.print(F("MPU6050,MPU9050,MPU9250,ITG3701,L3G4200D")); break;
    case 0x6A: Serial.print(F("LSM9DS1")); break;
    case 0x6B: Serial.print(F("LSM9DS0")); break;
    case 0x6F: Serial.print(F("Qwiic Button")); break;
    case 0x70: Serial.print(F("HT16K33,TCA9548A")); break;
    case 0x71: Serial.print(F("SFE7SEG,HT16K33")); break;
    case 0x72: Serial.print(F("HT16K33")); break;
    case 0x73: Serial.print(F("HT16K33")); break;
    case 0x76: Serial.print(F("MS5607,MS5611,MS5637,BMP280")); break;
    case 0x77: Serial.print(F("BMP085,BMA180,BMP280,MS5611")); break;
    case 0x7C: Serial.print(F("FRAM_ID")); break;
    default: Serial.print(F("unknown chip"));
    }
}
You are mixing Wire1 and Wire and setting pins where NOT required.
I have highlighted in RED what (I believe) are your errors.
I have compiled the code but NOT run it.

EDIT:
OK Highlighting code in RED does not work, but I have noted your errors in the code.
 
@BriComp
You're a Big Chief !
I was really mixing wire and wire1,just to try,i add those lines:
Wire1.setSCL(16);
Wire1.setSDA(17);
But doesn't change the result to work,so why are those lines commented, proposed to be uncommented?
is it because you can choose any pin to SDA & SCL?
I'm a little bit confused about that.
p.s.: how can we copy codes from the forum,only with Ctrl+C?
 
For what it is worth, here is a version of the scanner, that tries all of the Wire objects for a processor:
C++:
// --------------------------------------
// i2c_scanner
// http://playground.arduino.cc/Main/I2cScanner
//
// Version 1
//    This program (or code that looks like it)
//    can be found in many places.
//    For example on the Arduino.cc forum.
//    The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
//     Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26  2013
//    V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
//    by Arduino.cc user Krodal.
//    Changes by louarnold removed.
//    Scanning addresses changed from 0...127 to 1...119,
//    according to the i2c scanner by Nick Gammon
//    http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
//    As version 4, but address scans now to 127.
//    A sensor seems to use address 120.
// Version 6, November 27, 2015.
//    Added waiting for the Leonardo serial communication.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//
#include <Wire.h>
// BUGBUG::Should put this in WireIMXRT.h
#if defined(__IMXRT1062__)
#define WIRE_IMPLEMENT_WIRE
#define WIRE_IMPLEMENT_WIRE1
#define WIRE_IMPLEMENT_WIRE2
#endif
typedef struct {
  TwoWire *_wire;
  const char * wire_name;
  //IMXRT_LPI2C_t * const port;
} wire_list_t;
wire_list_t wireList[] = {
  {&Wire, "Wire", /*&IMXRT_LPI2C1*/}
#if defined(WIRE_IMPLEMENT_WIRE1)
  , {&Wire1, "Wire1", /*&IMXRT_LPI2C3*/}
#endif 
#if defined(WIRE_IMPLEMENT_WIRE2)
  , {&Wire2, "Wire2", /*&IMXRT_LPI2C4*/}
#endif
#if defined(WIRE_IMPLEMENT_WIRE3)
  , {&Wire3, "Wire3"}
#endif
};
const uint8_t wirelist_count = sizeof(wireList) / sizeof(wireList[0]);

void setup() {
  // uncomment these to use alternate pins
  //Wire.setSCL(16);
  //Wire.setSDA(17);
  for (uint8_t wirelist_index = 0; wirelist_index < wirelist_count; wirelist_index++) {
    wireList[wirelist_index]._wire->begin();
  }
  Serial.begin(9600);
  while (!Serial);        // Leonardo: wait for serial monitor
  Serial.println(F("\nI2C Scanner"));
}

void loop() {
  byte error, address;
  int nDevices;
  for (uint8_t wirelist_index = 0; wirelist_index < wirelist_count; wirelist_index++) {
    //IMXRT_LPI2C_t * const port = wireList[wirelist_index].port;
    Serial.print(F("Scanning("));
    Serial.print(wireList[wirelist_index].wire_name);
    Serial.println(F(")..."));
    nDevices = 0;
    for (address = 1; address < 127; address++) {
      // The i2c_scanner uses the return value of
      // the Write.endTransmisstion to see if
      // a device did acknowledge to the address.
      wireList[wirelist_index]._wire->beginTransmission(address);
      error = wireList[wirelist_index]._wire->endTransmission();
      if (error == 0) {
        Serial.print(F("Device found at address 0x"));
        if (address < 16) {
          Serial.print("0");
        }
        Serial.print(address, HEX);
        Serial.print("  (");
        printKnownChips(address);
        Serial.println(")");
        nDevices++;
      } else if (error == 4) {
        Serial.print(F("Unknown error at address 0x"));
        if (address < 16) {
          Serial.print("0");
        }
        Serial.print(address, HEX);
        //Serial.printf("MCR:%x MSR:%x, MIER:%x MDER:%x MCFGR0:%x MDMR:%x MCCR0:%x\n",
        //  port->MCR, port->MSR, port->MIER, port->MDER, port->MCFGR0, port->MDMR, port->MCCR0);
      }
    }
    if (nDevices == 0) {
      Serial.println(F("No I2C devices found\n"));
    } else {
      Serial.println(F("done\n"));
    }
  }
  delay(5000);           // wait 5 seconds for next scan
}

void printKnownChips(byte address)
{
  // Is this list missing part numbers for chips you use?
  // Please suggest additions here:
  // https://github.com/PaulStoffregen/Wire/issues/new
  switch (address) {
    case 0x00: Serial.print(F("AS3935")); break;
    case 0x01: Serial.print(F("AS3935")); break;
    case 0x02: Serial.print(F("AS3935")); break;
    case 0x03: Serial.print(F("AS3935")); break;
    case 0x0A: Serial.print(F("SGTL5000")); break; // MCLK required
    case 0x0B: Serial.print(F("SMBusBattery?")); break;
    case 0x0C: Serial.print(F("AK8963")); break;
    case 0x10: Serial.print(F("CS4272")); break;
    case 0x11: Serial.print(F("Si4713")); break;
    case 0x13: Serial.print(F("VCNL4000,AK4558")); break;
    case 0x18: Serial.print(F("LIS331DLH")); break;
    case 0x19: Serial.print(F("LSM303,LIS331DLH")); break;
    case 0x1A: Serial.print(F("WM8731")); break;
    case 0x1C: Serial.print(F("LIS3MDL")); break;
    case 0x1D: Serial.print(F("LSM303D,LSM9DS0,ADXL345,MMA7455L,LSM9DS1,LIS3DSH")); break;
    case 0x1E: Serial.print(F("LSM303D,HMC5883L,FXOS8700,LIS3DSH")); break;
    case 0x20: Serial.print(F("MCP23017,MCP23008,PCF8574,FXAS21002,SoilMoisture")); break;
    case 0x21: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x22: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x23: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x24: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x25: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x26: Serial.print(F("MCP23017,MCP23008,PCF8574")); break;
    case 0x27: Serial.print(F("MCP23017,MCP23008,PCF8574,LCD16x2,DigoleDisplay")); break;
    case 0x28: Serial.print(F("BNO055,EM7180,CAP1188")); break;
    case 0x29: Serial.print(F("TSL2561,VL6180,TSL2561,TSL2591,BNO055,CAP1188")); break;
    case 0x2A: Serial.print(F("SGTL5000,CAP1188")); break;
    case 0x2B: Serial.print(F("CAP1188")); break;
    case 0x2C: Serial.print(F("MCP44XX ePot")); break;
    case 0x2D: Serial.print(F("MCP44XX ePot")); break;
    case 0x2E: Serial.print(F("MCP44XX ePot")); break;
    case 0x2F: Serial.print(F("MCP44XX ePot")); break;
    case 0x33: Serial.print(F("MAX11614,MAX11615")); break;
    case 0x34: Serial.print(F("MAX11612,MAX11613")); break;
    case 0x35: Serial.print(F("MAX11616,MAX11617")); break;
    case 0x38: Serial.print(F("RA8875,FT6206,MAX98390")); break;
    case 0x39: Serial.print(F("TSL2561, APDS9960")); break;
    case 0x3C: Serial.print(F("SSD1306,DigisparkOLED")); break;
    case 0x3D: Serial.print(F("SSD1306")); break;
    case 0x40: Serial.print(F("PCA9685,Si7021")); break;
    case 0x41: Serial.print(F("STMPE610,PCA9685")); break;
    case 0x42: Serial.print(F("PCA9685")); break;
    case 0x43: Serial.print(F("PCA9685")); break;
    case 0x44: Serial.print(F("PCA9685, SHT3X")); break;
    case 0x45: Serial.print(F("PCA9685, SHT3X")); break;
    case 0x46: Serial.print(F("PCA9685")); break;
    case 0x47: Serial.print(F("PCA9685")); break;
    case 0x48: Serial.print(F("ADS1115,PN532,TMP102,LM75,PCF8591")); break;
    case 0x49: Serial.print(F("ADS1115,TSL2561,PCF8591")); break;
    case 0x4A: Serial.print(F("ADS1115")); break;
    case 0x4B: Serial.print(F("ADS1115,TMP102,BNO080")); break;
    case 0x50: Serial.print(F("EEPROM,FRAM")); break;
    case 0x51: Serial.print(F("EEPROM")); break;
    case 0x52: Serial.print(F("Nunchuk,EEPROM")); break;
    case 0x53: Serial.print(F("ADXL345,EEPROM")); break;
    case 0x54: Serial.print(F("EEPROM")); break;
    case 0x55: Serial.print(F("EEPROM")); break;
    case 0x56: Serial.print(F("EEPROM")); break;
    case 0x57: Serial.print(F("EEPROM")); break;
    case 0x58: Serial.print(F("TPA2016,MAX21100")); break;
    case 0x5A: Serial.print(F("MPR121")); break;
    case 0x60: Serial.print(F("MPL3115,MCP4725,MCP4728,TEA5767,Si5351")); break;
    case 0x61: Serial.print(F("MCP4725,AtlasEzoDO")); break;
    case 0x62: Serial.print(F("LidarLite,MCP4725,AtlasEzoORP")); break;
    case 0x63: Serial.print(F("MCP4725,AtlasEzoPH")); break;
    case 0x64: Serial.print(F("AtlasEzoEC")); break;
    case 0x66: Serial.print(F("AtlasEzoRTD")); break;
    case 0x68: Serial.print(F("DS1307,DS3231,MPU6050,MPU9050,MPU9250,ITG3200,ITG3701,LSM9DS0,L3G4200D")); break;
    case 0x69: Serial.print(F("MPU6050,MPU9050,MPU9250,ITG3701,L3G4200D")); break;
    case 0x6A: Serial.print(F("LSM9DS1")); break;
    case 0x6B: Serial.print(F("LSM9DS0")); break;
    case 0x70: Serial.print(F("HT16K33")); break;
    case 0x71: Serial.print(F("SFE7SEG,HT16K33")); break;
    case 0x72: Serial.print(F("HT16K33")); break;
    case 0x73: Serial.print(F("HT16K33")); break;
    case 0x76: Serial.print(F("MS5607,MS5611,MS5637,BMP280")); break;
    case 0x77: Serial.print(F("BMP085,BMA180,BMP280,MS5611")); break;
    case 0x7C: Serial.print(F("FRAM_ID")); break;
    default: Serial.print(F("unknown chip"));
  }
}

It has been awhile since I ran it, so hope it still works.
I was really mixing wire and wire1,just to try,i add those lines:
Wire1.setSCL(16);
Wire1.setSDA(17);
But doesn't change the result to work,so why are those lines commented, proposed to be uncommented?
is it because you can choose any pin to SDA & SCL?
I'm a little bit confused about that.
No not any pin, but some device may have more than one valid pin for these functions, and these calls allow you to choose which ones to use.

On a Teensy 4.1 the valid pins are:
SCL 16 (default) and 45
SDA 17 (default) and 44

Note: Pins 44 and 45 are pins in the SD card slot, which are a little harder to get to...
 
@KurtE
It's not rusty,it works very well,very handy tool ! :)
What is the procedure when you want to deal with differents modules with differents addresses on the same wire?
Wire1.beginTransmisstion(0x38);
Wire1.endTransmisstion(0x38);
Wire1.beginTransmisstion(0x27);
Wire1.endTransmisstion(0x27);
and so on ...?
 
You give the I2C address to beginTransmisstion() only. This is needed even if communicating with only 1 device, you always have to give the address. Of course for 2 devices, you give each address when you want to communicate with each specific chip.

The endTransmisstion() function does not take the address. It doesn't need the address, because it ends the transmission you previously started (you can't have more than 1 transmission at a time). Just call endTransmisstion() with no parameters.

For the sake of completeness, endTransmisstion() can take 1 true/false input for very special uses. But normally you would just call it with no input. See the various I2C examples.
 
Back
Top