Post Go back to editing

Configuration of ADT7420 and/or ADT7320


I have both temperature sensors ADT7420 and ADT7320, which use i2C and SPI respectively.I am new to C++ so I have been using already developed code on GitHub for the ADT7420 sensor as a template for my implementation (see photo). However, the value that I keep getting is 536884044, which is clearly not a temperature reading. Not only that, but this is the only value that can be retrieved from the device, hinting that maybe it is not configured/initialized correctly. How is this done using C++, without the EVAL board connected? I used this board to check everything was working correctly in the beginning, but for my application, only the temperature sensors will be used.

Note, in the ADT7320 datasheet, it reads that a command byte of {0x54} can be sent to the device to set everything to default and initialize the device, but this doesn't seem to do anything. I can transmit any value and still only output 536884044.

Any help is much appreciated, and my apologies if my code is garbage. 

Thank you!

enlarged photo for better viewing.
[edited by: bhathaway at 6:27 PM (GMT 0) on 2 Jun 2020]
  • Hi,

    To ensure the ADT7320 is properly initialized you actually need to load 32 consecutive 1s on DIN after powerup. Page 22 of the ADT7320 datasheet and page 23 of the ADT7420 datasheet detail a guide to measuring temperature in default powerup mode. 



  • Thank you Karen. 

    I did try that before actually but it did not work. I sent both an integer value of 11111111111111111111111111111111 and an integer array of 1’s with size 32. I’ve also tried sending both these packages as unsigned characters and unsigned integers. Again, no luck. The manual does not explain anything past “Load consecutive 1s” so I’m curious as to what format worked for other people. 

    Thanks again,