teensy 4.1 analog ins vs i2c

lokki

Well-known member
i was wondering why the i2c pins on the teensy 4.1 (but also other teensies) are on analog input channels? i wanted to migrate a project from a teensy 3.6. to a teensy 4.1. but would need all 18 analog inputs. seems like a waste to put those i2c pins on analog inputs, since all pins can be used for digital in, but not all for analog in. so you loose more functionality by putting them on analog inputs. is this intentional/non circumventable or could this be changed in future teensy boards?
 
The reason why is really the intersection of 3 factors.

1: NXP designed this way.

2: Many difficult decisions had to be made about which of the chip's GPIO pins to bring to the outside edges of Teensy 4.0 and 4.1. It was discussed for many months on this forum in the lead up to Teensy 4.0 and during a lengthy beta test period. Ultimately the decision was made to bring out 3 of the 4 I2C ports. Decisions that maximized many other features people wanted just happen to have selected the I2C pins which also have analog capability.

3: Since Teensy 3.0 we've tried to follow certain Arduino pin conventions which go back to the earliest days of Arduino Diecimila, Duemilanove, and Uno, such as Serial1 on pins 0-1, SPI on pins 10-13, analog starting with digital pin 14, and I2C on pins 18-19. So I2C1 and I2C2 ending up on analog pins was pretty much by factors #1 & #2, but I2C0 on pins 18-19 (A4-A5) was an explicit design goal.

These same factors will (probably) apply to future Teensy using other chips.
 
thanks for your in-depth answer. makes sense. i will see if i can rearrange my project to use fewer analog ins, or use a multiplexer...
 
Back
Top