Code Monkey home page Code Monkey logo

tca9548a-rk's Introduction

TCA9548A-RK

Particle driver for TCA9548A I2C multiplexer

This handy chip allows 8 separate I2C busses to be connected to a single I2C port. This is handy it you want to connect devices that have conflict I2C addresses. Or if you want to support multiple busses at different voltage levels.

I purchased mine from Adafruit which has the surface mount chip soldered on a handy breakout board.

Pinouts

Bottom side:

  • 1 - A0
  • 2 - A1
  • 3 - /RESET
  • 4 SD0
  • 5 SC0
  • 6 SD1
  • 7 SC1
  • 8 SD2
  • 9 SC2
  • 10 SD3
  • 11 SC3
  • 12 GND

Top side:

  • 13 SD4
  • 14 SC4
  • 15 SD5
  • 16 SC5
  • 17 SD6
  • 18 SC6
  • 19 SD7
  • 20 SC7
  • 21 A2
  • 22 SCL
  • 23 SDA
  • 24 VCC

Note that the Adafruit breakout board has built-in pull-up resistors on the SDL and SCL (to Photon/Electron) lines. These can be disabled by cutting two traces on the bottom side of the board.

Also the A0, A1, and A2 lines have internal pull-downs, so the default address is 0 with no connections. There are solder pads on the bottom to change the address permanently.

Finally, the /RESET line has a pull-up on it, so you don't have to connect it unless you want to be able to hardware reset the chip.

If you are using a bare TCA9548A chip you'll need to add your own ties to GND or VCC, and add pull-ups for I2C.

Also note that neither includes pull-ups on the expanded SDAn and SCLn ports! This is intentional so you can pull-up to either 3.3V or 5V depending on what voltage you want to run the bus at. Each port can be run at a different voltage as desired.

Test Circuit

Circuit

Examples

There's not much to this:

#include "TCA9548A-RK.h"

TCA9548A mux(Wire, 0);

void setup() {
	Serial.begin(9600);
	mux.begin();
	mux.setChannel(0);
}

void loop() {
}

In the constructor, pass the I2C object you are using, normally Wire (D0/D1). On the Electron you can use Wire1 (C4/C5) as well.

The second parameter is the address 0-7, based on what you've set the A0-A3 pins to. The default is 0.

From setup() typically you call mux.begin() to initialize the bus.

Then whenever you want to switch to a different bus, call mux.setChannnel.

Note that the I2C address of the TCA9548A must be different than the address of any I2C device on any bus connected on any of the channels 0-7 as well!

tca9548a-rk's People

Contributors

rickkas7 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.