Where to find what I2C address used.

Status
Not open for further replies.

DaQue

Well-known member
So far I don't see what primary and alt I2C address are usable on the audio board. A chip I need to run on the same port uses 2 actually. The need to be between 0x80 and 0x87 and need to see if there will be a conflict.
 
In the examples, there is at least one i2c scanner. If you run the the serial monitor, and then download/run the scanner, it will tell you what i2c devices are on the main bus.

In the case of the audio adapter, the SGTL5000 uses 0x0A and the WM8731 uses 0x1A.

In the case of the prop shield with motion sensors, the FXOS8700 uses 0x1E, the FXAS21002 uses 0x20, and the MPL3116 uses 0x60.
 
As Michael stated there is an I2C scanner in the examples. I could not locate it in my Arduino1.6.5 setup so I've attached it. Very useful utility.

/code
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not know.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
// Version 3, Feb 26 2013
// V3 by louarnold
// Version 4, March 3, 2013, Using Arduino 1.0.3
// by Arduino.cc user Krodal.
// Changes by louarnold removed.
// Scanning addresses changed from 0...127 to 1...119,
// according to the i2c scanner by Nick Gammon
// http://www.gammon.com.au/forum/?id=10896
// Version 5, March 28, 2013
// As version 4, but address scans now to 127.
// A sensor seems to use address 120.
//
//
// This sketch tests the standard 7-bit addresses
// Devices with higher bit address might not be seen properly.
//

#include <Wire.h>


void setup()
{
Wire.begin();

Serial.begin(9600);
Serial.println("\nI2C Scanner");

// pinMode(40, OUTPUT); // iCS3 tester debug to set relay on RTC
// digitalWrite(40, HIGH);
}


void loop()
{
byte error, address;
int nDevices;

Serial.println("Scanning...");

nDevices = 0;
for(address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();

if (error == 0)
{
Serial.print("I2C device found at address 0x");
if (address<16)
Serial.print("0");
Serial.print(address,HEX);
Serial.println(" !");

nDevices++;
}
else if (error==4)
{
Serial.print("Unknow error at address 0x");
if (address<16)
Serial.print("0");
Serial.println(address,HEX);
}
}
if (nDevices == 0)
Serial.println("No I2C devices found\n");
else
Serial.println("done\n");

delay(5000); // wait 5 seconds for next scan
}
/code
 
Thanks for the answer. Looks like I'm all set. I will check out the scanner as soon as my pcb for the oddball module I want to talk to shows up. You give some of the best answers, it's very much appreciated.
 
Thanks for the answer. Looks like I'm all set. I will check out the scanner as soon as my pcb for the oddball module I want to talk to shows up. You give some of the best answers, it's very much appreciated.

Note, if you are not attaching either of the boards I mentioned, you may need pull-up resistors between each of the SDA and SCL pins and 3.3v. if your device doesn't provide them If you only have a few devices on your i2c bus with relatively short wires, pull-up resistors of 2.2K or 2.4K are recommended for Teensy (Paul's shields contains the pull-up resistors, and you only need one pair per i2c bus).

If your device is 5v only, you will need to do a level shifting of the i2c bus.
 
It will share the I2C with the audio board and that has 2.2k pull ups. The traces from the teensy to the module are less than 2 inches and probably closer to an inch. It was a pain to route the required traces to two parallel dual row 0.05" spaced pins headers that are .3" apart. I finally gave up breaking out all 30 and just did the bare minimum. The chip is an old ISD 5116 made by Winbond years ago. It has 4 million analog storage cells and was used to store voice messages up to 16 minutes long. The data sheet is dated October 2000. I'm trying to save some that had announcements overwritten by messages due to a random glitches over the last 17 years.
 
Status
Not open for further replies.
Back
Top