After implementing the MLX90614 driver for NuttX I noticed that although the write command to change the device I2C address in the EEPROM was reporting success, after the power cycle the new address was not working. Worst: even the previous address was not working.
Basically the device appears damaged and didn’t respond to any I2C command.
Then doing my research I discovered a Melexis document about SMBus communication:
In this document I noticed they are using the address 0x00 instead of the default 0x5a address. After modifying the driver to use the 0x00 address the device accepted the new command.
There are many discussing about this subject on Arduino and similar forum:
Note that someone discovered that using a brute force CRC approach eventually will work and everybody decided to copy it. Too bad guys!
The MLX90614 uses CRC8-CCITT standard to check if data are correct, so any CRC8-CCITT implementation will work, for example this one: https://3dbrew.org/wiki/CRC-8-CCITT
Now on NuttX you can call the mlx90614 example application to change the device’s I2C address this way: (changing from default 0x5a to 0x3a)
nsh> mlx90614 0x3a Address 0x3a stored on your device! Please do a power cycle and update the I2C board address! nsh>