Go Down

Topic: Use more that one I2C multiplexer with Arduino ?? (Read 5704 times) previous topic - next topic

Fuzzy Wobble

i am trying to buy parts for an upcoming project.
can i use more than one of these i2c protocol multiplexers with arduino?
i would like to use three...
http://search.digikey.com/scripts/DkSearch/dksus.dll?WT.z_header=search_go&lang=en&site=ca&keywords=MCP23016-I%2FSP-ND&x=4&y=12

avenue33

Yes, according to the factsheet

Quote from: Features
• Three hardware address pins allow use of up to eight devices


Those pins are labelled A0, A1, A2.

Quote from: 1.6 Address Decoder
The last three LSb of the 7-bit address are user-defined (see Table 1-4).
Three hardware pins (<A2:A0>) define these bits.

TABLE 1-4:   DEVICE ADDRESS
Code: [Select]
0 1 0 0 A2 A1 A0

Grumpy_Mike

And if you want more than 8 you can actually feed the I2C bus through a data selector.

Fuzzy Wobble


Bill_Kerr

#4
Feb 04, 2011, 03:00 am Last Edit: Feb 04, 2011, 03:19 am by Bill_Kerr Reason: 1

And if you want more than 8 you can actually feed the I2C bus through a data selector.



Hi Fuzzy Wobble

The MCP23016 have been discontinued, so I would suggest ordering the replacement MCP23017

http://www.microchip.com/ParamChartSearch/chart.aspx?branchID=11034&mid=11&lang=en&pageId=79

If you have not used I2C before, check out Nick Gammon website for information he recently posted.
http://www.gammon.com.au/forum/?id=10896


With the quote above, I do not believe you need that complexity.   The I2C bus with MCP can have 8 devices on one SS (select) line. To create another set on the same bus, share the MISO/MOSI/SCK  lines, but create another CS (SS) select line for the next set of devices.  The only thing I have not checked is how many devices (loads) the ATMega can drive.

Regrads  Bill  
Don't you just hate ONE D 10 T problems?

macegr

Additionally, I have a shield for the MCP23017 readymade with 4 chips on the board, plus cable and breakout boards for getting the 64 I/O out to a breadboard or screw terminals.

Unique RGB LED Modules and Arduino shields: http://www.macetech.com/store

Nick Gammon

#6
Feb 06, 2011, 08:51 pm Last Edit: Feb 06, 2011, 09:01 pm by Nick Gammon Reason: 1

If you have not used I2C before, check out Nick Gammon website for information he recently posted.
http://www.gammon.com.au/forum/?id=10896


With the quote above, I do not believe you need that complexity.   The I2C bus with MCP can have 8 devices on one SS (select) line. To create another set on the same bus, share the MISO/MOSI/SCK  lines, but create another CS (SS) select line for the next set of devices.  


Thanks for the mention! I find it helps me to understand things if I document them.

However I think in this case you are confusing SPI with I2C. SPI uses MISO/MOSI/SCK/SS lines, not I2C.

As far as the original question goes, since the expander has 16 ports, and you can multiplex up to 8 of them by jumpering the address-select lines, that gives you 128 ports which is probably enough for all but the most ambitious project. After that, another approach would be to use a second Arduino (this takes some of the processing load off the first one) and connect the two Arduinos together using SPI.

The expander shield looks cool BTW! Where do you get that? (EDIT: Oh, I see from the signature).
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Grumpy_Mike

Quote
the replacement MCP23017


Note that there are two versions of this.
MCP23017 - I2C interface
MCP23S17 - SPI interface
Using the SPI interface is a lot faster than the I2C

Phisheye


Additionally, I have a shield for the MCP23017 readymade with 4 chips on the board, plus cable and breakout boards for getting the 64 I/O out to a breadboard or screw terminals.


I realise that this is an old thread but hope that someone knowledgable will reply: Is the MCP23017-based board from macetech just a port expander or is it actually an I2C MUX that would enable me to connect many I2C devices with the same slave address to a single Arduino Uno?  If it's the latter then I want one!

Nick Gammon

As you can see from the photo it is 4 x MCP23017 chips on a board. So it is 4 port expanders. Since each one has 16 ports that gives you 64 ports in total.

It is not an I2C MUX.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics


I have triple 2 channel 4053.
Can you give example code   for 4053?
two i2c convert to one i2c.

Grumpy_Mike

Quote
Can you give example code   for 4053?

???
Just put out the channel you want to select on the pins attached to the three control lines on the chip. That is pins 11, 10 and 9 on the 4053.

Go Up