teensy 4.1 wire,wire1

Status
Not open for further replies.
Yes, you use the same include file (Wire.h), and there are 3 instances of the I2C support for each I2C bus:
  • Wire to address the I2C bus on pins 18, 19;
  • Wire1 to address the I2C bus on pins 17, 16; (and)
  • Wire2 to address the I2C bus on pins 25, 24.

Note, depending on the devices on each I2C bus, you may need to add pull-up resistors between each of the I2C pins and 3.3v. Many I2C devices have pull-up resistors, but not all do.

One problem is a lot of the I2C libraries were designed on platforms that only had one I2C bus, so there isn't often a way to specify which bus to use. Some newer libraries now take an additional argument to specify the I2C bus to us. Alternatively, you would need to clone the software and rename it. Inside of the renamed code, you would change Wire references to either Wire1 or Wire2.
 
Status
Not open for further replies.
Back
Top