|
Incomplete list of I2C address usageHopefully this might save you having to scroll to page 46 of a datasheet just to find the prefix Also see Adafruit's THE LIST though note they use right-justified/Arduino form so remember to multiply by 2 Terms used to describe bit usage:
Left-justified bit ordering is preferred as the 4-bit prefix fits entirely in the first hex digit and the pin-strapped address+R/W bit fits in the second hex digit. The process of using a bitwise-or operation to add the "read" bit fits well with common "C" programming practice, and the resulting 8 bit word is well suited to simple bit-bang implementations of I2C. Arduino sketches typically use Right-justified addressing, meaning that I2C addresses taken from sketches need to be multiplied by 2. This fits well with assembly language where the Read bit might be passed in the processor's "carry" bit and combined with the 7 bit address using a rotate instruction. It appears that the Microchip MCC (XC8) mostly uses right-justified addressing. Disadvantages of the right-justified form:
Unavailable addresses0000 prefix0000xxxx Reserved addresses that should not be used for device addressing 00000000 I2C General call 00000001 Start Byte, an interesting one: where devices use software polling a master can transmit this as a "wake up" code. Because of the lack of transitions a relatively low poll rate is sufficient to detect bus activity. 0000001X Reserved for CBUS, no longer in use. 0000010X Reserved for different bus formats 0000011X Reserved, just reserved... 00001XXX Reserved for high speed mode, serves to "warn off" incompatible devices. 1111 prefix1111xxxx Reserved addresses divided into:
0001 prefixThis range appears largely unused 0010 prefixThis range appears largely unused 0011 prefix0011XXXR Many sensing devices use this address range 0011011R TC654 fan controller (fixed address) 0011AAAR MCP9808 temperature sensor 0100 prefix0100AAAR PCF8575 I/O expander 0100AAAR Microchip MCP23008, MCP23017 GPIO devices 010000AR PCAL6416A Voltage translating GPIO, very configurable 0101 prefix01010AA0 MAX521 octal 8 bit DAC (Write only) 0101AAA0 MAX520 quad 8 bit DAC (Write only) 0101AAAR SC18IS602/602B/603 I2C-bus to SPI bridge 0101AAAR LM96080 System Hardware Monitor 0101110R LM96000 Hardware Monitor with Integrated Fan Control (Default address) 010110AR LM96000 Alternate addressing, loses one fan to provide an address pin 01010001 Honeywell ASDX pressure sensor common "2A3" or "2A5" variant (read only) 0110 prefix0111 prefix100 prefix100AAAAR INA260 Current and Power sensor (uses two "4 state" address pins) 1001 prefix1001BBBR TC74 Temperature sensor 1001101R TC74A5 Temperature sensor common variant 1001AAAR PCF8591 8 bit ADC and DAC 1001BBBR MCP3021 10 bit ADC 1001BBBR MCP3221 12 bit ADC 1001101R MCP3221A5 12 bit ADC common variant, 1001000R variant also seen 1001AAAR Alternate address for MCP9808 temperature sensor from datasheet, factory order only and there is no mention of a special part number so unlikely to be found "in the wild" 1010 prefix1010XXXR Memory devices 1010XXXR Some Microchip EEPROMS 1010AAAR Typical EEPROM with three address pins 110 prefix110A0A0R SiT3521 I2C/SPI Programmable Oscillator I2C "G" option. Because of the odd way A1 and A0 have been implemented this part maps into either the 1100 group with A1 grounded or the 1101 group with A1 floating. Note that with both address pins floating it gets 1101010 which is unlikely to conflict with anything other than another SiT3521 1100 prefix1100BBAR MCP4725 DAC Fixed VDD Vref 1100BBBR MCP4726 DAC with Vref pin 1100BBBR MCP4728 Quad 12 bit DAC with internal reference, default 1100000R but address bits stored in EEPROM, rewritable (requires manipulation of LDAC pin) 1100AAAR TPIC2810 open drain 40V driver 11000A0R SiT3521 I2C/SPI Programmable Oscillator I2C "G" option, A1 grounded 1101 prefix1101000R PCF8523 Real Time Clock and other RTC 1101BBBR MCP3421 18 bit ADC (6 pin package) 1101000R and 1101001R common 1101BBBR MCP3422 18 bit ADC (8 pin package, 2 channel) 1101000R common 1101AAAR MCP3423, MCP3424 using three-state inputs to get 3 bits from two address pins 11010A0R SiT3521 I2C/SPI Programmable Oscillator I2C "G" option, A1 floating 11011AAR Relatively unused sub-range, worth considering for microcontroller devices 1110 prefixSpecialBBB10001 Honeywell ASDX pressure sensor note device is read only, also the datasheet address is given in 7 bit format, address code "2" converts to control byte 0x51. AAAAAAAR NXP devices using the newer 4-state address scheme: PCA9698 40 pin GPIO, 1AAAAAAR PCA9685 PWM/LED controller has 6 address pins Two bit per pin address methodNewer devices may allow twice as many bits to be set, by allowing each pin to have 4 states. Address pins may be wired to VSS, VDD, SDA or SCL, encoding 4 states. In the PCA9698 the resulting 6 bit value is expanded into a 7 bit address space in a way that leaves some "gaps". Voltage divider address methodA voltage is used to encode multiple address bits, typically 3 or 4. This requires accurate resistor ratios, though for experimentation a variable resistor might be used.Using I2C address pins for module codingThere are a number of small I/O modules available that can be connected to a controller board by a 4-wire I2C "jumper" carrying data, ground and power. A problem with this approach is that multiple modules of the same type will have the same address unless modified. An alternative scheme is to use connectors with more than 4 pins, lets say we allow seven pins. Four are the normal power and data, then the remaining three are the device address pins. A daisy-chain cable is used with multiple connectors. One four-way connector connects to the microcontroller. Then there are eight seven-way connectors and the first one is hardwired to have all the address pins grounded to code "000", the next has one pin positive to code "001" and so on. This gives each connector an address and a module connected to that connector takes that address. This scheme also works well with a "backplane" PCB holding modules. A refinement would be to give each module an "in" and "out" connector and include a small amount of logic so whatever address was put on the "in" connector appeared modified at the "out" connector. A two-bit scheme might be implemented using one inverter or single FET. Each module takes its A0 and outputs it as A1, and its A1 is inverted to become A0. This gives addresses of 00, 01, 11, 10 or assuming the use of pull-up resistors 11,10,00,01
|