Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 5 of 5

Thread: T4.1 Invert I2C pin-out?

  1. #1
    Junior Member
    Join Date
    Mar 2020
    Posts
    18

    T4.1 Invert I2C pin-out?

    Hi,

    I'm making a new "mother" board design with Teensy 4.1 with two slot for "daughter" board.

    As I want slot 1 and slot 2 board can be inverted, I have a pin-out problem

    on slot 1 : PIN 1 : TX6-SCL2 (T4.1 : 24)
    PIN 2 : RX6-SDA2 (T4.1 : 25)
    on slot 2 : PIN 1 : TX4-SDA1 (T4.1 : 17)
    PIN2 : RX4-SCL1 (T4.1 : 16)

    So, I2C pin are inverted on slot 2....

    Is there a way to invert I2C Pin-out on Teensy 4.1?

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    1,372
    These are hardware mappings set in stone (well silicon). Short of overriding all the relevant #defines for the I2C symbols
    I don't see a way.
    Why would this matter? Just document it! Or wrap in a library layer?

  3. #3
    Junior Member
    Join Date
    Mar 2020
    Posts
    18
    Quote Originally Posted by MarkT View Post
    These are hardware mappings set in stone (well silicon). Short of overriding all the relevant #defines for the I2C symbols
    I don't see a way.
    Why would this matter? Just document it! Or wrap in a library layer?
    I want to do this because I'm making some daughter board for exemple: i2c on one type and Serial com on a second type. But I want to be able to put any daughter card in any mother board slot.

  4. #4
    Senior Member
    Join Date
    Dec 2016
    Location
    Wales
    Posts
    122
    The I2C, as Mark says, is set in silicone. The chips have dedicated hardware to run these busses that are only available on certain pins. If you mean to say you want to swap the pin locations you can't do this using the teensy's hardware.

    I'm not sure I understand why you can't use the appropriate pins, and if you're designing the hardware then definitely you should do this. Otherwise, you could use something like https://github.com/todbot/SoftI2CMaster which is a software I2C library that lets you use any two pins, but at the cost of extra processor usage.

  5. #5
    Senior Member
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,444
    ...which would not be dramatic as the i2c lib is blocking anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •