I2C Basics. How to assign address to I2C slave devices.

Status
Not open for further replies.

[URW]

Newbie level 3
Joined
Jan 12, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
NC, USA
Activity points
1,310
Hello all, nice to see an active FPGA Forum here.

I am involved in a Spartan 6 prototype design involving an I2C Master Core. It is a well proven core that is thankfully shared on OpenCores.org. My design involves this single Master controlling 4 I2C slave devices, 3 are identical frequency synthesizers, the last I2C controlled device is a video IC (registers only).

My question is: How does the master core go about assigning addresses, and communicating with each of the freq. synth's individually? In the beginning won't all IC's respond back at the same time?
 

In I2C protocol the first byte of the packet sent from the master sets up the addressing and whether a read or write operation will be performed. The slave device will send an acknowledge bit if the byte received matches its internal address. The address of the slave device can be set up different ways, in hardwired pins to Vcc or GND, or set in internal memory depending on the device.
 

Each slave will have its device predefined address given by manufacturer. the manufacturer provides option to connect multiple devices in the form of address pins as A0, A1,A2 as in eeprom if the device supports multiple device interface. So look at the data sheet of the device you are using and see if they provide multiple address selection pins.

i2c tutorials
An I2C Tutorial.
 

>>>My question is: How does the master core go about assigning addresses, and communicating with each of the freq. synth's individually? In the beginning won't all IC's respond back at the same time?

The master doesn't assign the address of each slave I2C chip.

Each I2C chip is different and depending upon how the manufacturer, it will fall into one of the following groups.

#1 - One fixed address. You can't change it.

#2 - Address pin(s). One or more pins on the chip set the address according to a predefined address that was hardset by the factory. Pins might increment the address 0x20, 0x21, 0x22, 0x23; or they various addresses 0x20, 0x28, 0x30, 0x38 or 0x20, 0x60, 0xA0, 0xC8. This is found in the datasheet of each chip.

#3 - Configurable Address stored in EEPROM or FLASH registers. The chip will ship from the factory with some set address, then you send a command to change the address. The protocol will be specified in the datasheet. If a chip is using EEPROM or FLASH memory to store all settings, then you are more likely to see this feature in those types of chips.
 

First, thanks for all the responses, and the tutorial...

The 3 identical frequency synthesizers I am using is a DS1085. According to the data sheet I send a 1101_xxx where xxx is the address. So I can hook up a max of 8 of these on the I2C bus. This much is clear to me. But, since they all come from the factory with xxx=000, won't they will all respond to my address modification? or the fastest one will? Do I need to put power jumpers in, program each one and manually change the jumpers to activate each IC, in order to initially program in each unique address?
 

As far as I can see you either need to program them before you put them on the board or provide some means of separating them with jumpers to get them initially programmed.

Keith.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…