19

Now I know in order to have an I2C address reserved for yourself you have to pay the I2C people some money. But I don't want to do this.

I'm asking for advice on what address I should choose for my slave and master MCUs on my project. There will also be an EEPROM on the board. So I will avoid using the address of the EEPROM. I plan for the master to connect to a wide range of sensors, including gyros and accelerometers, and perhaps additional memory devices. Are there any blocks of addresses I should stay clear of? I was thinking of just using 0x00 for the master and 0x01 for the slave, because those seem to be rarely used.

Another question: would it be a bad idea to mix 10-bit devices and 7-bit devices on the same bus? I was considering the possibility of having my MCUs communicate with 10-bit addressing, but only using 7-bit addresses for sensors.

Thomas O
  • 31,546
  • 57
  • 182
  • 320
  • Are you going to have a port available for people to add I2C devices as they wish or will it always be devices you add? – Kellenjb Dec 05 '10 at 19:20
  • @kellenjb, There will be an expansion port to allow the addition of devices, but only some will be supported. i.e. it won't support a motor control IC, but it will support an accelerometer. – Thomas O Dec 05 '10 at 19:45
  • Interesting bit of info: NXP says it'll only cost you 2500 EUR for a I2C address allocation. What a bargain! – W5VO Dec 05 '10 at 22:12
  • 1
    @W5VO. Yep, right next to the SD card people only wanting $3,000. – Thomas O Dec 05 '10 at 23:56
  • 1
    @ThomasO, you do not need to pay them to get an address reserved, like an identifier, you do not have to pay this to make a device, they are selling a service. SDcard they are enforcing their intellectual property, they can tell you to do it or choose a different technology. – Kortuk Dec 06 '10 at 00:18
  • @kortuk, I was making a sarcastic comment on the cost of these things. – Thomas O Dec 06 '10 at 00:33
  • 1
    @ThomasO, I was making a point that there is something that you are paying for in this case. Also, two thousand is not much in a real product. – Kortuk Dec 06 '10 at 03:54
  • 1
    @Thomas O $3,000 is actually very reasonable for products. This is a drop in the bucket for any company making products. – Kellenjb Dec 06 '10 at 03:58
  • @kortuk, @kellenjb In 10 years time maybe when it is a drop in the bucket, and I'm not a poor student any more. :) Then I could buy me one of those Agilent InfiniScopes, now only $133,000! – Thomas O Dec 06 '10 at 09:46
  • @Kortuk, @Kellenjb - Sure, thousand-dollar licenses are a drop in the bucket for an *established* company *already* making products, but they're a huge, possibly insurmountable barrier to students (Like Thomas and myself), to new startups, and to open hardware. – Kevin Vermeer Dec 06 '10 at 20:49
  • 2
    @reemrevnivek, but the patent holder chose that they would rather require that and cause open-hardware not to be able to allow use, and require paying this fee. as the patent holder, they have that right. I am, until laws change, going to make sure this is clear. I would like patent and copyright overhaul, but until they are, this is how engineers whom have good ideas are protected and rewarded. – Kortuk Dec 07 '10 at 03:50
  • 1
    @Kortuk - I wasn't trying to advocate anything illegal. I was disagreeing not with your support of the right of patent holders to impose those fees, or our obligation to pay those fees, but with your support of the fees as reasonable, a good value, and inconsequential. – Kevin Vermeer Dec 07 '10 at 21:41
  • @reemrevnivek, I think you may have typo'ed because I am confused by your sentence. 2 grand could be a lot more for an SD card which many project have a necessity. When you are making a product you are selling, 2 grand should be almost nothing, costs less than paying your engineers for a week, which is significantly less time then it would take your engineers to redesign it. Think, 1 month (short estimate) to get flash memory set up, then add in other features, or 2 grand to get sd card. – Kortuk Dec 07 '10 at 23:02
  • No, I did not make a typo. I'm advocating that NXT should get back to selling ICs, some which might have a communication bus of which they are the author, and sell support for and moderate that communication bus, allowing them to sell more ICs. They should avoid discouraging potential new users with fees. However, they don't, so we have to live within the system. – Kevin Vermeer Dec 08 '10 at 01:08

4 Answers4

20

Pick a device you positively won't be using in your design and use it's I2C address. For instance, if you won't be needing a RTC, you can use 0xA2 and 0xA3, which are used by the NXP PCF8563 (and probably other RTCs).

stevenvh
  • 145,145
  • 21
  • 455
  • 667
  • i like this, very clever. – NickHalden Jun 10 '13 at 16:50
  • Unfortunately some devices still still clash, for instance the [ST STCN75](http://www.st.com/web/en/resource/technical/document/datasheet/CD00153589.pdf) and [TI DAC8571](http://www.ti.com/lit/ds/symlink/dac8571.pdf) or the [Microchip 24AA025E48](http://ww1.microchip.com/downloads/en/DeviceDoc/22124D.pdf) and [TI ADC121C027](http://www.ti.com/product/adc121c027). – Xcodo Jan 28 '15 at 14:35
15

First, don't use 0x00 and 0x01, those are reserved! Table 3 of the I2C Bus Specification lists the reserved addresses (and reasons why):

Slave addr  R/W        Description
 0000 000    0     General call address
 0000 000    1     START byte
 0000 001    X     CBUS address
 0000 010    X     Reserved for different bus format
 0000 011    X     Reserved for future purposes
 0000 1XX    X     Hs-mode master code
 1111 1XX    1     Device ID
 1111 0XX    X     10-bit slave addressing

You should also steer clear of 0x00 because that has no edge transitions, and might be an error condition (and it's hard to debug).

Other than that, I'd say "Just make it configurable." If you want to be able to plug in a wide variety of sensors, then you can either pay NXP for an address, or give it adjustable addresses. Software modifications should be obvious if you want to distribute the source code. A hardware option to toggle one or two bits of your selected address (solder jumpers on digital pins) is cheap and easy, or a ladder network of resistors with jumpers connected to an A/D pin could give you complete control in the hardware.

Yankee
  • 363
  • 1
  • 12
Kevin Vermeer
  • 19,989
  • 8
  • 57
  • 102
  • 1
    +1 for configurable address. I have seen this on slaves that will have several of the same thing on the same bus. – Kellenjb Dec 05 '10 at 19:58
  • Yeah I was thinking of configurable addresses. It could be updated by changing settings from the menu system. One important thing is that safeguards need to be added to prevent someone changing the address and the master MCU losing communication with the slave, so some kind of protocol needs to be established which resets the addresses (e.g. after 5 seconds have no communication so reset address.) – Thomas O Dec 06 '10 at 09:48
12

Here is a list of allocated addresses as of 1999: http://www.nxp.com/acrobat_download2/selectionguides/SELGUIDE.PDF

They don't release a full list with this reasoning:

Q: Is it possible to receive a list of all I²C-slave addresses used to date?

A: No. NXP Semiconductors do not issue this list of all previously assigned slave addresses, as this is the only way we can guarantee the list stays up to date and each assigned address is unique. If this list were made available, I²C-bus licensees would start selecting slave addresses themselves and the central list would soon become incomplete, which could lead to address conflicts. The principle established, proven to work well, is that each licensee sends a slave address request to a single contact within NXP Semiconductors, who then allocates the slave address based on a single master list.

From http://www.nxp.com/products/interface_control/i2c/faq/

Now, if everything is going to be internal to your project, there is no reason you can't just select any address that you want as long as it doesn't conflict with anything you plan on connecting.

Kellenjb
  • 17,509
  • 5
  • 51
  • 87
  • Odd reasoning: by having no list they ensure to keep the list up to date... :-/ – Federico Russo Jun 12 '11 at 13:10
  • Simple reasoning: they want to ensure that anyone who allocates IDs will have a truly-up-to-date list; having out-of-date copies of the list floating around would undermine that goal. – supercat Sep 08 '11 at 23:25
  • 1
    @Federico They have a list, they just don't publish it so that people are forced to go through them to make sure that the list is up to date. If the list was published there would be tons of people who pick unused address, then what happens when someone properly reserves that address? – Kellenjb Sep 08 '11 at 23:44
  • FWIW: SELGUIDE.PDF is in the Internet Archive [link](https://web.archive.org/web/20110714215136/https://www.nxp.com/acrobat_download2/selectionguides/SELGUIDE.PDF) – HiTechHiTouch Feb 10 '18 at 08:09
2

As Kellenjb says you won't get a full list of slave device addresses.

However there are several reserved addresses which you can not use (0x00 for example is the general call address).

The list is here

Mixing 10 and 7 bit addressing is fine as long as the 7bit slaves obey the I2C standard and ignore 10 bit addresses.

Mark
  • 11,627
  • 1
  • 31
  • 38