Hi,
I am working with TMP006 sensor and PIC 16F877A . I had already interfaced the sensor with PIC using I2C. The problem is when I had tried to send the slave address initially, the slave does not responds ie I don't get any acknowledgement from the slave.So it stays in the loop. Here I had given TMP006 address as 0x40(only using one sensor). So I don't not connect ADR0,ADR1and DRDY pins. Is this a problem for not getting the acknowledgement from slave?. I had attached the code along this thread. Can somebody suggest solution for this..
Regards,
Nithn
void write16(unsigned int addr, unsigned int reg, unsigned long data) { I2C_Start(); // Start i2c communication // //!!!!here is the problem, the slave dosen't acknowledges and stay's in the loop // while((I2C_Write_Byte(addr + 0) == 0)); I2C_Write_Byte(reg); // Write Address byte I2C_Write_Byte(data >> 8); // Write data byte I2C_Write_Byte((unsigned char)data); I2C_Stop(); // Stop i2c communication }