I2C device

Do you have EEPROM installed on the eval board?

yes :slight_smile:

How do you connect Gadgeteer to the eval board?

with the suit pins (data, clock and ground)

I am trying to find that connector on the eval board (that exposes I2C pins). Where is it?

Even if you have a connector, you will not be able to communicate with the EEPROM if the board is set for I2C mode because the TUSB8040A will also be a master.

I2C does not support more than 1 master.

If you put the board into SMBus mode you might be able to talk to the EEPROM but there is no guarantee the USB HUB device will interfere with this.

Can you confirm which device you are trying to read? Is it the EEPROM or the TUSB8040A device?

@ Dave McLaughlin

My thought was if the device is in SMBus mode then there should be no issues to talk to EEPROM, because the device will be SMBus slave. Am I wrong?

I have 2 more question-
what is I2C Buss limits support of clock rate KHz?-(it’s hang by the I2C device, but which device won’t be supported in the class?

and another one-
If I try to read \write to I2C device, when actuall- there is no connected one, what supposed to be? thrown exception\ another return value-, there is a way I should know by the code I tried to write when there is no connected device?

Question 2. If there’s no device connected, you won’t get the expected response. Totally depends on what the device is.

Take for instance an I2C device that just returns the temperature. If the bits come back all the same, either the temperature is at maximum (or minimum), but it could also mean there’s no device. You have to interpret the datasheet to control that.

why I need the data sheet for it?
I want to know what happen in case I write, for example

Socket socket = Socket.GetSocket(3, true, this, null);
 // Init I2C
 i2c = new GTI.I2CBus(socket, 0x68, 100, this); 
i2c.write(new byte[]{0x32,0x34},300);

and actually, now- socket number 3 isn’t connected to any module.
the code wold fail?
when?
or only return me in the write function-0 or -1 or something like that

simplistically, you can also look at return values of WRITE method.

Why do you need to look at the data sheet? Because ultimately the device may well return you other details that you need to understand !

1 Like

ok, hope I understood.
sure I need the Data sheet, I meant only for this question… :slight_smile:

what about my first question, and I edited it:
what is the limit values of clock rate (KHz) in the I2C bus?
I believe the main board influences about- I use FEZ Spider and G120HDR.