TCA9548A i2C multiplexer

  Переглядів 7,229

Curious Scientist

Curious Scientist

3 роки тому

In this video I show a nice device that can help us to use multiple i2C circuits with the same i2C address. There are circuits which have fixed i2C addresses, which means that you can only use one of them on a selected i2C bus. If you try to connect several of them, there will be a conflict on the bus and you would not be able to use them. This multiplexer (MUX) resolves this issue and allows you to use 8 devices with the same address at the same time. The way it works is very simple: first we select which channel we want to use by sending a command to the MUX, then we access the i2C device which is connected to the selected channel.
Please don't forget to subscribe!
Schematics and source code: curiousscientist.tech/blog/tc...
If you want to support my work, please consider buying the parts using my affiliate links:
curiousscientist.tech/tools

КОМЕНТАРІ: 38
@7alfatech860
@7alfatech860 3 роки тому
Its good to learn that the address of the multiplexer is itself selectable. Nice video... like that it is short and to the point.
@CuriousScientist
@CuriousScientist 3 роки тому
Yes, the changeable address is a neat feature! Finally, I could make a shorter video, there was not too much to explain here.
@shecterelectric432
@shecterelectric432 2 роки тому
Before seeing this video, I didnt know how to use multiple steppers/encoder together. Thank you very much!
@CuriousScientist
@CuriousScientist 2 роки тому
You are welcome! I am glad that I could help.
@foldi001
@foldi001 2 місяці тому
Thank you!
@CuriousScientist
@CuriousScientist 2 місяці тому
Cheers!
@isidoromaich7226
@isidoromaich7226 3 роки тому
Is a great solution for several inconvenients. I just wonder how fast it, in practice, is handling its child devices. I will look forward your next video to see more about this.
@CuriousScientist
@CuriousScientist 3 роки тому
Yes, it is a very nice circuit! As I mentioned in the video, I will check it with two AS5600 circuits. Since I will need to read them fast, it will be a great test for this circuit.
@ralmslb
@ralmslb 2 роки тому
From TI datasheet, should be plenty fast and not noticeable. In standard mode supports a max I2C clock frequency of 100kHz and in Fast Mode goes all the way up to 400kHz. I don't know the downsides of using the Fast mode to be honest.
@JorgeCaztro
@JorgeCaztro 2 роки тому
@@CuriousScientist Hi friend ... Have you uploaded the video with the mux and the AS5600 yet?
@CuriousScientist
@CuriousScientist 2 роки тому
Hi! Yeah, about a year ago... Maybe you should subscribe to the channel. :)
@JorgeCaztro
@JorgeCaztro 2 роки тому
@@CuriousScientist claro que si estoy suscrito... muy buen contenido!!!
@Kireita
@Kireita 2 роки тому
thank you!
@CuriousScientist
@CuriousScientist 2 роки тому
You're welcome!
@mohamedadam3085
@mohamedadam3085 Рік тому
Do you have a tuturai that shows how to connect multiple AS5600 with multiplexer? Because I tried this your method and didn't work with AS5600 chips, noisy angle reading ect........
@CuriousScientist
@CuriousScientist Рік тому
I don't know what the hell "tuturai" is, but you might find this video interesting: ukposts.info/have/v-deo/gYpheq-ghI-FlWw.html
@mustafaguvenli2733
@mustafaguvenli2733 2 роки тому
Hi, How can I do for multiple SHT20 sensors? I couldn't find multiple examples for these sensors on the internet. I would be glad if you can help with this. Have a nice day.
@CuriousScientist
@CuriousScientist 2 роки тому
Hi! I have never worked with the above mentioned sensors, but you just have to switch between the different channels on the MUX board and then reach the different sensors.
@kevinhoublon8630
@kevinhoublon8630 Рік тому
Hello, great video 😁, I'm a beginner and I have a question : Can the TCA9548A multiplexer work with the MCP23017 GPIO Expander? Thank you in advance for your precious support 😄 Cordially.
@CuriousScientist
@CuriousScientist Рік тому
Hi and thanks! Why would you multiplex the MCP23017? You can create 8 different addresses using its A0, A1, A2 pins. Thus, you can chain up 8 of these chips using the same i2c bus. But if you need even more I/O expanders, then yes, you can use this i2c MUX. But as long as you are below 8 chips, I recommend using the MCP23017's address pins. It is much simpler.
@kevinhoublon8630
@kevinhoublon8630 Рік тому
@@CuriousScientist Hello, thank you very much for your feedback. I wanted to control 2 MCP23017 with an arduino board using I2C but since the MCP23017 devices have the same address, I planed to rely upon the TCA9548A multiplexer which can control devices with the same address. -On one hand, the TCA9548A multiplexer would be connected to the arduino board -On the other hand, the TCA9548A multiplexer would be connected to the 2 MCP23017 devices I prefer your solution of using the pins A0, A1, A2 of the MCP23017. Just to be sure : Does it mean I have to connect the pin A0, A1 and A2 of each of my MCP23017 to the pins of my arduino (for example the pin 4,5 and 6 for the first MCP23017 and 7,c8 and 9 for the second ) and send on pin A0 to A2 a byte? Do you have a link explaining how to do so? Thank you in advance for your precious support 😁. Cordially 😊
@CuriousScientist
@CuriousScientist Рік тому
Hi! They do not have the same address unless you give them the same address on purpose (or leave their address pins untouched). There are three pins A0, A1 and A2 on the MCP23017 chip and depending on how you configure these pins (HIGH or LOW), the address will be different. Read the datasheet of the chip about how to configure their address if you are unsure. Just to clarify. You do not need to connect the A0, A1 and A2 pins anywhere on the Arduino. Depending on what board you use for the MCP23017, there will be 3 jumper pins, or DIP switches, or solder tabs. You have to play with those, the Arduino does not have to be involved with the addressing. I recommend you learn this first because working with an i2c multiplexer is much more complicated.
@kevinhoublon8630
@kevinhoublon8630 Рік тому
@@CuriousScientist Hello, thank you very much for your feedback 😁 and your explanation. Ok, I'll check how to set up the address for the 2 MCP23017. I'll come back to you if I have other questions. Have a nice weekend, 😁. Cordially 😊
@patoromero1229
@patoromero1229 Рік тому
Can use 6 accelerometers with this multiplexor?
@CuriousScientist
@CuriousScientist Рік тому
You can use up to 8 i2c devices with this multiplexer.
@codebeat4192
@codebeat4192 3 місяці тому
2:00 It is not true that when two devices of the same type at the same address (like in the video), for example a display, cause a conflict on the I2C bus. When these devices are on the same address, they act and update exactly the same. The problem is (if that is a problem) that you cannot change them individually because they listen to the same address.
@CuriousScientist
@CuriousScientist 3 місяці тому
Well, that's the problem that you want to update them individually while they hold the same address. The video shows how to solve that issue with the multiplexer.
@codebeat4192
@codebeat4192 3 місяці тому
@@CuriousScientist You said there is a conflict, there is no conflict. There is only a conflict when there are two devices (or more) at the same address, the same functionality and the MCU asking for data or at a totally different functionality (different devices). The last one with different devices on the same address and asking for data, ruin your I2C communiction completely. You can also make a sniffer, a listener, to any address you want, doesn't matter.
@CuriousScientist
@CuriousScientist 3 місяці тому
It depends on how you want to interpret the word "conflict". I am not a native English speaker, so let me have a few mistakes. I provided a useful solution for an issue for free, so let's not get stuck with some "misuse" of words. 😉
@EricBalcon
@EricBalcon 2 роки тому
It works fine with uno but nothing on DUE...can't figure out what's going on
@CuriousScientist
@CuriousScientist 2 роки тому
Well, "doesn't work" is a very vague description, so I can't figure it out either.
@EricBalcon
@EricBalcon 2 роки тому
Yes, sorry, probably it's a problem with SDA SCL , on the due I don't use A4 or A5 . I tried on A4 and A5 to make sure but nothing works...
@CuriousScientist
@CuriousScientist 2 роки тому
Due uses pin 20 (SDA), and 21 (SCL), you must use those pins.
@EricBalcon
@EricBalcon 2 роки тому
@@CuriousScientist yes , i did
@danielcristina6748
@danielcristina6748 2 роки тому
Exemple ne fonctionne pas
@CuriousScientist
@CuriousScientist 2 роки тому
English please.
Fast serial communication with Arduino
46:22
Curious Scientist
Переглядів 6 тис.
#148 TCA9548A I2C MULTIPLEXER (& Voltage Shifter)
38:00
Ralph S Bacon
Переглядів 25 тис.
😳 Домінація! ОГЛЯД БОЮ ЛОМАЧЕНКО - КАМБОСОС
04:06
Arduino Multiplexor - MUX INPUTS & OUTPUTS - ANALOG and PWM
13:21
Electronoobs
Переглядів 95 тис.
AS5048A 14-bit magnetic position encoder
36:21
Curious Scientist
Переглядів 16 тис.
#33 Internet of Things with ESP8266 #5: Watchdogs, Timers & Stability
9:17
Arduino, ADS1115 16-Bit ADC with I2C Bus and Adafruit Library - The Details
41:51
Robert's Smorgasbord
Переглядів 20 тис.
Decoupling Capacitors - And why they are important
7:39
Lalo Solo
Переглядів 309 тис.
Try these 16 Brilliant ESP32 projects!!!
11:18
ToP Projects Compilation
Переглядів 516 тис.
How to use two I2C modules that have the same address?
7:14
Brainy-Bits
Переглядів 26 тис.
CNC encoder wheel with stepper motors
35:15
Curious Scientist
Переглядів 21 тис.
📱 SAMSUNG, ЧТО С ЛИЦОМ? 🤡
0:46
Яблочный Маньяк
Переглядів 615 тис.
Apple Event - May 7
38:22
Apple
Переглядів 6 млн
Игровой ноутбук за 100тр в МВИДЕО
0:58
KOLBIN REVIEW
Переглядів 711 тис.