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

Thread: teensy and TCA9548A pullup resistors

  1. #1

    teensy and TCA9548A pullup resistors

    hello
    im trying to scan a TCA9548A ports but i dont get the right address. the address i find in scan its for another i2c device that connected to my teensy 3.6. this device i2c bus connected to 3v with pullup resistors.
    do i need allso to use pull up resistors from 3v to the to TCA9548A i2c bus? i read in adafruit site that its all ready have pullup resistors.
    my TCA9548A is connected to 5v. and scl sda to pins 37 38.

    im using this test code:
    Code:
    /**
     * TCA9548 I2CScanner.pde -- I2C bus scanner for Arduino
     *
     * Based on code c. 2009, Tod E. Kurt, http://todbot.com/blog/
     *
     */
     
    #include "Wire.h"
    extern "C" { 
    #include "utility/twi.h"  // from Wire library, so we can do bus scanning
    }
     
    #define TCAADDR 0x70
     
    void tcaselect(uint8_t i) {
      if (i > 7) return;
     
      Wire.beginTransmission(TCAADDR);
      Wire.write(1 << i);
      Wire.endTransmission();  
    }
     
     
    // standard Arduino setup()
    void setup()
    {
        while (!Serial);
        delay(1000);
     
        Wire.begin();
        
        Serial.begin(115200);
        Serial.println("\nTCAScanner ready!");
        
        for (uint8_t t=0; t<8; t++) {
          tcaselect(t);
          Serial.print("TCA Port #"); Serial.println(t);
     
          for (uint8_t addr = 0; addr<=127; addr++) {
            if (addr == TCAADDR) continue;
          
            uint8_t data;
            if (! twi_writeTo(addr, &data, 0, 1, 1)) {
               Serial.print("Found I2C 0x");  Serial.println(addr,HEX);
            }
          }
        }
        Serial.println("\ndone");
    }
     
    void loop() 
    {
    }
    Last edited by rotabox; 03-09-2019 at 04:33 PM.

  2. #2
    Junior Member
    Join Date
    Dec 2018
    Location
    Scotland
    Posts
    12
    Hello Rotabox,

    Had the same problem and confusion with the documentation. Try using 4.7KOhm to pull up the Teensy SCL and SDA to Vcc. Someone will confirm but I believe the Teensy needs a stronger pull up than some other boards. I did not need any extra pull ups on the TCA outputs ports.

    It sounds like you are using this product from Adafruit?

    Also, remember you can select another I2C address for the TCA (using the A0,A1, A2 pins on the breakout board) to avoid conflicts?

    I bought a few TCA9548A on breakouts from Ebay (Adafruit clones), they all failed. The Adafruit boards worked fine for me.

    HTH,
    Mike
    Last edited by Mike554; 03-09-2019 at 05:09 PM. Reason: terrible spelling!!

  3. #3
    hi mike tnx for answer i guess my tca is clone its a purple board
    i measure the SCL and SDA voltage and i got 3.8v in both. so as far as i know i dont need pullup resistors.
    i dont find any reason to change the address of the tca coz its sopsed to be 0x70 and my scan find 0x00 and 0x66 address of my other device.
    thats weird.

  4. #4
    Junior Member
    Join Date
    Dec 2018
    Location
    Scotland
    Posts
    12
    Hi,

    The purple boards did not work as expected for me, strange but true. The Adafruit boards have been flawless for me at least.

    All I can say is I have to use pull ups on the Teensy SCL and SDA to get the I2C to work reliably. Why not try with pull ups and maybe remove the other I2C devices to simplify troubleshooting?

    Good luck,
    Mike

  5. #5
    Quote Originally Posted by Mike554 View Post
    Hi,

    The purple boards did not work as expected for me, strange but true. The Adafruit boards have been flawless for me at least.

    All I can say is I have to use pull ups on the Teensy SCL and SDA to get the I2C to work reliably. Why not try with pull ups and maybe remove the other I2C devices to simplify troubleshooting?

    Good luck,
    Mike
    sure my next step is to remove the other device and scan
    if ill not find anything ill give it a try with pullup resistor to 3v.
    did you try everything with the purple board with out success?

  6. #6
    Quote Originally Posted by Mike554 View Post
    Hi,

    The purple boards did not work as expected for me, strange but true. The Adafruit boards have been flawless for me at least.

    All I can say is I have to use pull ups on the Teensy SCL and SDA to get the I2C to work reliably. Why not try with pull ups and maybe remove the other I2C devices to simplify troubleshooting?

    Good luck,
    Mike
    so i test with out the other device and i get in test 0x00 in all ports i measure the voltage of scl sda of my other device and its 3.3v.
    im preaty afraid to add more 3.8 volts to the tca.

  7. #7
    Junior Member
    Join Date
    Dec 2018
    Location
    Scotland
    Posts
    12
    Quote Originally Posted by rotabox View Post
    sure my next step is to remove the other device and scan
    if ill not find anything ill give it a try with pullup resistor to 3v.
    did you try everything with the purple board with out success?
    Just about Yes. One was dead on arrival. The others all developed failed ports after a short time of use. So I did get them to work just not for long. It is still my understanding that external pull ups are needed on Teensy I2C.

  8. #8
    Quote Originally Posted by Mike554 View Post
    Just about Yes. One was dead on arrival. The others all developed failed ports after a short time of use. So I did get them to work just not for long. It is still my understanding that external pull ups are needed on Teensy I2C.
    i read a bit about the tca now and i tryd go for 2k2 pullup resistors now the voltage on tca SCL SDA is 3.6 volt.
    and i still dont see it on any scan i tryd.

  9. #9
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,021
    I would cut to disable the adafruit pullups since they may be fed to 5V, while your attempting to pull it to 3V? 3.6 is pretty high for a teensy pin

    all i2c devices should have their (if installed) resistor pullups disabled and only one set should be near the microcontroller. Also be sure that the I2C device doesnt use 5V logic on the i2c lines

  10. #10
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,453
    Seeing 3.6V means the Teensy’s pin protection diode is trying to limit the voltage by clamping it to 3.3V, having itself a forward voltage of 0.3V. You are definitively in the danger zone, here!

  11. #11
    i found the trace on the adafruit of pullups its have two 2k2 resistors to the 5v.
    should i cut them? and should i use external resistors 2k2 to 3v (witch is allredy conected)?

  12. #12
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,021
    you cant pull up to 2 different voltage sources... cut the adafruit board trace to disable them
    Make sure the device doesnt toggle the sda/scl lines at 5 volts either

    I suggest since your using a 3.3v teensy to apply 3.3V to the VIN of the adafruit board, as suggested by adafruit, and NOT 5V

    Vin is connected to 5V (on a 3V logic Arduino/microcontroller, use 3.3V)

  13. #13
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    2,453
    One day, I’d like to understand why people buy and connect 5V peripherals to 3.3V processors... Nobody would replace their 12V car battery with a 24V pack from a truck...

    Friends, the 5V era is almost over! Don’t buy that stuff which is still sold for compatibility with the old asthmatic 8bit AVR processors like the Arduino UNO. 3.3V is the current industry standard, 1.8V is already at the horizon.

  14. #14
    ok so i cut it and now the pins SCL SDA getss 3.3v
    i scan again and all i get is 0x00 and 0x66
    0x66 thats my other device still not getting this 0x70Click image for larger version. 

Name:	Screen Shot 2019-03-10 at 1.38.30 AM.jpg 
Views:	11 
Size:	65.5 KB 
ID:	16112

  15. #15
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    3,021
    did you cut the adafruit trace ?

    if so, you need pullup resistors near teensy.
    if not, you shouldnt use the teensy ones.

    as per my last post the VIN on the adafruit board should be connected to 3.3V, NOT 5V. Theres a 3.3V pin 250mA output on teensy you can use for such a board provided it doesnt draw more than ~80% of that power suggestively

    you have a connection diagram ?

  16. #16
    i gets 3.3v now on SDA SCL PINS
    i cut the pullups trace on tca board.
    i use 2k2 external resistor from SDA SCL to 3.3v on teensy .
    and the scan still like the pic above.
    im still running 5 v on VIN il chang it now and give it a try
    Last edited by rotabox; 03-09-2019 at 11:15 PM.

  17. #17
    i switched to 3.3 v VIN and still nothing on scan.
    all SDA SCL on tca ar 3.3 v.
    Last edited by rotabox; 03-09-2019 at 11:49 PM.

  18. #18
    Quote Originally Posted by Mike554 View Post
    Hi,

    The purple boards did not work as expected for me, strange but true. The Adafruit boards have been flawless for me at least.

    All I can say is I have to use pull ups on the Teensy SCL and SDA to get the I2C to work reliably. Why not try with pull ups and maybe remove the other I2C devices to simplify troubleshooting?

    Good luck,
    Mike
    I orders adafruit original it really more expensive but I must it for my project.
    I'm gonna connect it to 3v VIN.
    Did u use allso external pullup resistor and allso used the pullup thats comes on bord?

Posting Permissions

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