Pages: [1]   Go Down
Author Topic: two I2C devices on one uno?  (Read 562 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am hoping to connect a sparkfun altimeter breakout board and a sparkfun compass breakout board to one uno. I currently have the altimeter working on analog 4 & 5. The problem is that they both communicate over analog 4 & 5. Is there a way to point to analog 2 & 3 for one and default to 4 & 5 for the other?
Logged

UK
Offline Offline
Faraday Member
**
Karma: 99
Posts: 4153
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I²C is a bus based system.  You connect both devices to the same I²C bus, and you give each device a separate address.

How you do that with your shields should be in the manual or datasheet for them.
Logged

Get 10% off all 4D Systems TFT screens this month: use discount code MAJENKO10

Offline Offline
Sr. Member
****
Karma: 1
Posts: 322
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What about 2 of the same device on the same processor?

I would like to test different designs for an RTC board.  All the boards will use the DS1307 RTC chip.  I want to test several at the same time and compare drift of the different designs.  Since they all have the same address, they can't be on the same bus.  Is there a way to attach an I2C device to pins other than A4 and A5?
Logged

Grand Blanc, MI, USA
Offline Offline
Faraday Member
**
Karma: 93
Posts: 3972
CODE is a mass noun and should not be used in the plural or with an indefinite article.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What about 2 of the same device on the same processor?

I would like to test different designs for an RTC board.  All the boards will use the DS1307 RTC chip.  I want to test several at the same time and compare drift of the different designs.  Since they all have the same address, they can't be on the same bus.  Is there a way to attach an I2C device to pins other than A4 and A5?

Only if you write the protocol bit-bang style for other pins. Maybe someone has done it already? I might Google around a bit.
Logged

MCP79411/12 RTC ... "One Million Ohms" ATtiny kit ... available at http://www.tindie.com/stores/JChristensen/

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

Quote
What about 2 of the same device on the same processor?
You then need to switch the bus with data select lines.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 525
Posts: 26554
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here's an I2C Mux chip on a breakout board.
http://www.dsscircuits.com/i2c-multiplexer.html

Uses the PCA9544A,
4-channel I2C-bus multiplexer with interrupt logic
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: