MLX90640 (32x24) how to change I2C adress

Hi, I would like to know how to change I2C address in sensor mlx90640. Maybe anybody working on it ?

Write the value to address 0x240f and power cycle.

Based on the datasheet p.19 it appears you have to write this to the 0x240F EEPROM register (LSB of that register is listed as being the I2C address). Example data given is 0xBE33, and with 0x33 the default address I think you have to change that to the desired address. No explicit example given in the data sheet so it remains a guess.

Interesting that this device uses 16-bit registers and data.

Thanks for your reply. I read datasheet carefully and I tried this :
1.Read register 0x240f or 0x8010 (result of both is 0xBE33 where 33 is slave address)
2.Write to 0x240f or 8010 new value f.e. 0xBE01 (where BE is reserved for melexis and 01 is new slave address)
3.POR (reconnect power supply on pin 3.3V)

But it still don't work. I think the problem is in my POR because I don't clearly understand how to do that (It could be do it in program or can I do it mechanical ?).
In the previous version of melexis I found extra information : before we write new value to the register we should erase this register (write 0x0000). But I'm not sure it's a good idea because if something go wrong x00 slave address will lock device.

ralphpl:
But it still don't work. I think the problem is in my POR because I don't clearly understand how to do that (It could be do it in program or can I do it mechanical ?).

Maybe there's a command yo send to the sensor over I2C that makes it perform a reset - check the data sheet.

Otherwise, a power cycle will always work.

0x01 is a reserved address and the melexis chip might know that. Use a valid address!

Hi thanks for your reply. I have instruction how to do that :

1.Power on the device
2.Write 0X000 (i.e. erase the cell) to 0X240F
3.Wait 10ms (so the write process is complete)
4.read back 0X240F to make sure the erase process has been successful
5.Write the new value for instance 0XBE01 (make sure the BE remain intact and 01 is the new slave address)
6.Wait 10ms (so the write process is complete)
7.read back 0X240F to make sure the write process has been successful
8.Power off the device

That code doesn't compile. Post complete code, if you use external library post a link to it! And use code tags to post code (that's the </> button in the editor)!

I have instruction how to do that :

Where did you get them? From Melexis?

What I'm doing wrong, the code still does not work?

"Does not work" is not a precise description. Post the output of the code.

I solved my problem I use another i2c library and i wrote code in C instead C++. Thank for help.

Hi,

Could you please describe how you solved the problem? I face the same problem.

Thank you

Can anyone post the code on how to change the I2C address

Here is the code that I used just now, successfully. It is written for C# Netduino but perhaps it will help you. Same steps as outlined above by Ralphi
public ChangeAddress()
{
using (OutputPort i2cPort = new OutputPort(Pins.GPIO_PIN_SDA, true)) // Toggles SDA. This is necessary on Netduino Plus 2
{ // to wake up I2C. I don't know why.
i2cPort.Write(false);
Thread.Sleep(100);
}
Netduino.Foundation.Communications.I2CBus _I2C;
_I2C = new Netduino.Foundation.Communications.I2CBus(0x33, 400); // configure I2C
UInt16 Result = _I2C.ReadUShort(0x240F, Netduino.Foundation.Communications.ByteOrder.BigEndian); // should be 0xBE33 (original address is 0x33)
_I2C.WriteUShort(0x240F, 0, Netduino.Foundation.Communications.ByteOrder.BigEndian); // erase register
Thread.Sleep(10);
Result = _I2C.ReadUShort(0x240F, Netduino.Foundation.Communications.ByteOrder.BigEndian); // should be zero
_I2C.WriteUShort(0x240F, 0xBE32, Netduino.Foundation.Communications.ByteOrder.BigEndian); // write new address, 0x32
Thread.Sleep(10);
Result = _I2C.ReadUShort(0x240F, Netduino.Foundation.Communications.ByteOrder.BigEndian); // should be 0xBE32
}