Pages: [1]   Go Down
Author Topic: Use more that one I2C multiplexer with Arduino ??  (Read 5136 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

France
Offline Offline
God Member
*****
Karma: 11
Posts: 638
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
0 1 0 0 A2 A1 A0
Logged


Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 7
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

excellent. just wanted to make sure.
Logged

Calgary, AB
Offline Offline
Newbie
*
Karma: 2
Posts: 46
Arduino Newbie
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  
« Last Edit: February 03, 2011, 09:19:07 pm by Bill_Kerr » Logged

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

SF Bay Area
Offline Offline
Edison Member
*
Karma: 11
Posts: 1244
Arduino Ninja
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
« Last Edit: February 06, 2011, 03:01:22 pm by Nick Gammon » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is not an I2C MUX.

Thanks for the clarification.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 603
Posts: 33408
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: