Closed ckuethe closed 7 years ago
Section 7.4.1 of the datsheet says that the indicates that EEPROM starts at 0x20
, thus config register 1 (0x05
in the EEPROM space) is address 0x25
. On my MLX90614BAA:
>>> cfg = bus.readfrom_mem(0x5a, 0x25, 2)
>>> cfg
b'\xb4\x9f'
>>> "{0:b}".format(ustruct.unpack('<H', cfg)[0])
'1001111110110100'
>>> "{0:b}".format(ustruct.unpack('<H', cfg)[0] & 0x40)
'0'
>>>
I might have been confusing in the title when I said _B_
... I meant to suggest xBx
rather than Bxx
It appears we are working off different datasheets. Would you mind posting a link to yours?
I have been using: https://www.melexis.com/-/media/files/documents/datasheets/mlx90614-datasheet-melexis.pdf
You'd assume the one linked to on their website would be the most recent: https://www.melexis.com/en/product/MLX90614/Digital-Plug-Play-Infrared-Thermometer-TO-Can ~Not in this case!~ My mistake. I misread the SparkFun datasheet date as 2016 when it was actually 2006! Thanks for the contribution. I'll review and merge shortly.
The Melexis datasheet is more recent than the Sparkfun version, but they do eventually express the same information. I found their use of "opcode" to be kind of confusing and would have preferred them to simply say that RAM is mapped starting at address 0x00 and EEPROM is mapped starting at 0x20.
Thanks for pointing me to the Melexis version; that explains some behavior I was seeing.
Just as a heads up, I'll have a few more changes for you:
.ambient_temp
object_temp2
to object2_temp
My
A
version's config register0x05
has bit 6 = 1, which according to the datasheet meansDual IR sensor
, however, when I try to read two bytes from0x08
, it always returns 0.