Post Go back to editing

ADT7420 Incorrect DeviceID

Category: Software
Product Number: ADT7420
Software Version: NA

Hi,

May I ask if there's any available program for ADT7420? A snippet will do. I am trying to read registers (using I2C), but it seems like I'm getting incorrect default value. Maybe there's something wrong with my code in reading registers? Can anyone help me about it? Thank you.

e.g Trying to read device ID

Wire.beginTransmission(0x48);

Wire.write(0x0B); // register to read the device ID

Wire.endTransmission();

Wire.requestFrom(0x48,1); //1 byte since Device ID is 1byte

x = Wire.read();

Serial.print(x,hex);

I am getting a value of 0x0D from the 0x0B register which is the device ID but it should be 0xCB;

-Grenna

Top Replies

  • Hello  ,

    What you're actually reading is the value at the default address of the pointer register (0x00). This is caused by the lack of a repeat start after writing the register to be read to the…

  • Hi Grenna,

    Reading back data from the configuration registers should look like this. 

    Checking your code, the address and register byte are correct. Please double check if your are not violating any timing specs. 

    Regards,

    Mae

  • Hello  ,

    What you're actually reading is the value at the default address of the pointer register (0x00). This is caused by the lack of a repeat start after writing the register to be read to the address pointer register. To correct this, you simply have to implement a repeat start after sending the Wire.write(0x0B) line. If I'm not mistaken that you're implementing this on an arduino, you can do the correction by simply changing the Wire.endTransmission() line to Wire.endTransmission(false). 

    Regards,

    Karlo