Hi all,
Please i need some help with my I2C switch communication, i have two I2C devices connected to a channel(01) of the Switch. These devices(EEPROM and Temp. Sensors) have addresses 0x54 and 0x1C respectively. I start by writing the switch address which is 0x70 followed by a read command. I then write(0x01) to the channel registers of the Switch to select channel one. I then write the address of the temperature sensor(0x1C) followed by a register address in the temp. sensor(0x00). when i run this i don't seem to any result. am i sending the right commands the right way? Please what am i doing wrong?
Help me please...
I2C_start(RFI2C_BASE,0x70,1); // Slave address in write mode
I2C_write(RFI2C_BASE,0x01,1); // write to channel and a stop condition
I2C_write(RFI2C_BASE,0x1C,1); // address of the temp. Sensor (0x1C);
I2C_write(RFI2C_BASE,0x00,0); // register 00 in the temperature sensor
for(i=0; i<18; i++){
//Temp_read_data[i][0] = I2C_read(0x1c,0); // memory read
printf("\n LOCAL Temperature is \t%x\n",I2C_read(RFI2C_BASE,0));
}
//=======output shown below
LOCAL Temperature is ff
LOCAL Temperature is ff
LOCAL Temperature is ff
LOCAL Temperature is ff
//========================