I am trying to use a Melexis MLX90614 with Atmega8. I have failed in all my attempts till now. I tried sending this sequence
slave address(as 0x00 and 0x5A) --> opcode to read SMBus address --> data byte high --> data byte low
I get a slave address NACK for both SMBus addresses. Is it because I am using an I2C library? I understand we have to give a PEC also, but as the Slave address is NACK'd I don't think the sensor is responding to my commands. I tried using the write opcode and got ACK's for that. So the communication is ok. Can anyone tell me what kind of problem may be here?
Also how would one generate a PEC for SMBus protocol?
I looked at this code and it just sends 0x00 and 0x07 over i2c to fetch two bytes of temperature. How can that be possible? In the datasheet it is specifically mentioned how to read one word and how to write one word. How can this be bypassed?