number of I2C pins on Teensy 3.2 through 3.5

Status
Not open for further replies.

badithev

New member
Hello, Could some help me understand what it meant to say Teensy 3.2 through 3.6 have
2,3 and 4 I2c pins? Does it mean i can connect three I2c 3.3v and address them appropriately?

Thank you
 
If you are talking about: https://www.pjrc.com/teensy/techspecs.html

The line: talking about I2C ports? An I2C port has two pins associated with it: SCL (clock) and SDA (data)
Each of these ports can connect to several devices using addressing.... More details up at: https://www.pjrc.com/teensy/td_libs_Wire.html

So for example With Teensy 3.2, which has two I2C ports

You can connect to that port using the Wire object which by default is on pins SCL:19 and SDA 18

You can use the second port using the Wire1 object using pins SCL 29 and SDA 30

On Teensy 3.5/3.6 default pins are:
Wire - SCL 19 SDA 18
Wire1 - SCL 37 SDA 38
Wire2 - SCL 3 SDA 4

Teensy 3.6 added 4th:
Wire3 - SCL57 SDA 56
 
Note, that most i2c device libraries only talk to the first i2c device (Wire), which is on pins 19 (SCL) and 18 (SDA). If the library doesn't have support for alternate i2c buses, you will either need to put all of the devices on the first i2c bus. Or you need to clone the library, and rename it. Within the cloned library, you would change all references of 'Wire' to 'Wire1', 'Wire2', or 'Wire3' as appropriate.

On the 3.2/3.5/3.6, there are alternate pins 17 (SCL) and 16 (SDA) for the first i2c bus (Wire). You would need to use the 'Wire.setSDA' and 'Wire.setSCL' functions to change to the alternate pins.

There is an alternate i2c library (https://forum.pjrc.com/threads/21680-New-I2C-library-for-Teensy3) that may provide some additional features over the standard library.

In each distinct i2c bus, if none of your devices have pull-up resistors, you will need to add two pull-up resistors (one between SDA and 3.3v and the other between SCL and 3.3v). On 3.3v microprocessors like the Teensy, you can typically use 2.2k resistors. If a device is meant to be run on either 3.3v or 5v, it may have a 4.7k resistor.
 
Thank you and the next member for help. Any suggestions on how to tap oval pins 56 & 57 ? Just seems it requires extraordinary skills to solder?
 
Small wire, like #30 "wire wrap" works pretty well. But you need to make sure the wires have a little extra length and be careful with handling, so you don't pull or stress the wire.

Since almost nobody uses Wire3 (the other 3 are almost always enough), it is disabled by default in the code. You need to edit WireKinetis.h to enable it.
 
Status
Not open for further replies.
Back
Top