Hi nox, Paul, et. al,
Thanks, nox, very much for this library!
I'm currently trying to get a MLX90620 16x4 IR sensor talking with a Teensy 3.0.
The old code for this used what looks to be an outdated i2c lib, so I'm trying
to get it up to date. I've gotten some of the stuff to work, but am flummoxed
by various attempts at reading the IR sensor array from RAM. The thing that has
me hung up is a command to the sensor at Slave Address 0x60. The command format is
0x60; //slave address
0x02; //read RAM command
0xYY; // start address of ram to read
0xZZ; // byte step to make- this seems to be 1 for more than one address to be read, there's an MSB and LSB
0xWW; // number or addresses to read (two byte chunks, it seems, highest value shown is 0x40, 64,(16x4)
Sending it a bunch of writes of the appropriate values doesn't work, even for
the one value read that the old code uses.
I was able to get a similar command (read bytes in eeprom) to work by doing thusly:
____________
Wire.beginTransmission(0x50); // slave address of eeprom chip on IR reader
Wire.write(0x00); //dump all eeprom command
Wire.endTransmission();
//this was put inside a read loop, and I read everything just fine.
Wire.requestFrom(0x40,1,I2C_NOSTOP);
theDatum = Wire.readByte();
________
One other caveat I just noticed, these guys say to specify the Slave address (0x60)
plus a write bit (0xC0)- looks like it needs another zero bit before continuing? If
I put in C0 for the address I get an "slave address not acknowledged", so it does look like it's
talking to 0x60 when it's set to such...any way to slip in another bit at the end of that
before the next (command)byte?
They say:
1. Start condition (Falling edge of SDA while SCL is high)
2. Slave address (SA=0x60) plus write bit = 0xC0
3. Command = 0x02
...
The datasheet for the sensor is
http://www.melexis.com/Assets/Datasheet-IR-thermometer-16X4-sensor-array-MLX90620-6099.aspx
if any kind soul wants to get a better look at the commands.
Any and all help, greatly appreciated. Beer is offered. More details if you need them, just ask.
Thanks.