Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C/SMBus Melexis MLX90614 IR Termometr

Solved!
Go to solution
I use NI-8451 interface to read temperature from Melexis IR termometer, that use SMBus protocol. Using I2C mode I can read RAM for actual temperature readout, but can not cooperate with EEPROM. Did any one made comunication with termometer? There is some specific behaviour: IR device reply at each adress, but there is no results for command that (sholud) changes I2C/SMBus addres. I have made any sugested actions (like disconnect/reconnect) and still have readout at each adress. In fact I need three or four devices at single bus and that is reason why I am looking for solutions.
Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 1 of 6
(9,522 Views)

Can you provide some of the code that doesn't work so I can compare it to the data sheet to make sure you are not making a simple coding error?

0 Kudos
Message 2 of 6
(9,520 Views)

Sure. I probably missed something, but now I'm stuck.

Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Download All
0 Kudos
Message 3 of 6
(9,508 Views)

...and documentation.

Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 4 of 6
(9,492 Views)
Solution
Accepted by topic author Zbigniew_StS

Ok. I see 4 mistakes in your code

1. On your Read_Termometer_NI_send.vi, you are only reading 2 bytes on the read when it appears the Melexis returns 3 bytes (Data Low, Data High, PEC).

2. You are doing a left shift of 1 on the I2C_Termom_Addr. Our API uses a 7-bit address. With the default address of 0 this is okay, but when you change the address this will no longer work.

3. On your write, you are splitting the request into multiple writes (Write (Command), Write (Data Low, Data High, PEC)). This will create the incorrect pattern on the bus. You must use a single write with all 4 bytes. Also, I don't know if the read will do any good. You probably always need to do a write/read. Again, this would need to do a read of 3 and a write of just the EEPROM_SMBus_Address to read it back.

4. You are passing a zero for the PEC. I think it needs to be the correct 8-bit CRC on the first three elements (Command, Dala Low, Data High) or else the command will likely be rejected by your device.

0 Kudos
Message 5 of 6
(9,460 Views)

Hello, would you kindly upload your working code please.

Best Regards

0 Kudos
Message 6 of 6
(7,091 Views)