Main Site Documentation

I2c


#1

Can I connect multiple devices to the one I2C master? My understanding is that they can all exist on the same bus, as each is identified individually? If so, how many could you have?

cheers


#2

I2C uses 7-Bit addresses, you can connect upto 112 devices on a I2C bus, theoretically. Some addresses are reserved for special use.
Practically it’s more dificult. Depends on cable length, what I2C device been used. There is no plug&play. Each device has it’s own hardware address or address range (described in the datasheet). If you wan’t to connect many devices of the same type you need to select a specific device address for each device (mostly done by address pins).


#3

Yes You can as long as they have a different address space
@ Robert only some devices are byte address, most are word address this includes 24LC series of memories

2 x 24LC1024 are about as big as it gets as they are paged by 64k
The address is 0xA0 + pins 1,2,3 but on the 24lc1024 only one address pin is available so only two can be connected so the max with these devices is 256k there is I believe bigger SPI memories but I’ve never gone down that line

24LC1024 is a 128 kilo byte device…

Cheers Ian

P.S just check over the forum as this topic has been discussed before… You must create an instance of each I2C device not just one for the I2C bus.

Wooh Sorry Robert I’ve got memory devices in my head for some reason

Robert was right Initial address is 7 bit (I should read through first)


#4

Wow thats awesome thanks guys :slight_smile:


#5

I’ve had a small “accident” with my relay16 board and domino.
Somehow it must have had a short circuit or whatever.

I replaced the mcp23016 on the relay board, and that now works fine with my cobra board.
But it still doesnt work with my domino, which is a problem.

I have tried to search the forum/fezzer … for procedures on how to use i2c on other pins than 2&3, but havent been able to find anything.

Can anyone suggest how I get the i2c up and running again?

Thanks,
Lars


#6

Please start new topic for help next time so we can help you netter.

Those are the only pins you can use for I2C because they have hardware support internally. Not to worry, you can implement I2C in software on any pin. It will be slower but you can use any pins. Here is a starting point http://www.tinyclr.com/forum/1/1647/


#7

Thanks Gus, I will do so.

As mentioned earlier its for the relay16 board. Do I need special arrangements like pull-up resistors if using say dio9 & 10?


#8

Good question. I am not sure but it wouldn’t hurt to add pull up resistors anyway