AnsweredAssumed Answered

Getting strange valors from ADT7320 (same in ADT7310)

Question asked by HFreitas on Sep 11, 2015
Latest reply on Oct 8, 2015 by Lluis

Hello,

 

I'm using your temperature sensor ADT7320 in a project but i'm getting wrong data (the same is true for ADT7310).

The circuit used is in Figure 14 (Typical SPI Interface Connection) of the sensor datasheet, where the microcontroller is an Arduino Uno.


The configuration register (0x01) is set to work in continuous mode & 16 bits (0x80):


Send.png


And this is what i get when i read the temperature register (0x02):


Get.png

The room temperature read with a thermocouple is approximately 24 ° C. When i heal a little bit the sensor i'm getting strange data:


Get(error).png


Resuming how the program works:


Setup:


-> Start SPI(CPOL = 1 ; CPHA = 0)


-> CS UP

-> Delay 300 ms

-> CS LOW

-> Sending 32 bits of '1'

-> CS HIGH


Loop:


-> CS LOW

-> Send: 0x08

-> Send: 0x80

-> CS HIGH


-> Delay 300 ms


-> CS LOW

-> Send: 0x50

-> Receive MSB while sending 0xFF

-> Receive LSB while sending 0xFF

-> CS HIGH


-> Convert the data.

-> Display data.


-> Delay 300 ms


With a supply of 3.3V i'm getting this (while heating a little bit):


MSB (BIN, HEX, DEC): 1100 - C - 12

LSB (BIN, HEX, DEC): 10100110 - A6 - 166

DATA (BIN, HEX, DEC): 110010100110 - CA6 - 3238

 

 

Temperature = 25.26 ºC

 

 

MSB (BIN, HEX, DEC): 1100 - C - 12

LSB (BIN, HEX, DEC): 10110011 - B3 - 179

DATA (BIN, HEX, DEC): 110010110011 - CB3 - 3251

 

 

Temperature = 25.36 ºC

 

(the problem)

 

MSB (BIN, HEX, DEC): 110100 - 34 - 52

LSB (BIN, HEX, DEC): 110100 - 34 - 52

DATA (BIN, HEX, DEC): 11010000110100 - 3434 - 13364

 

 

Temperature = 104.24 ºC

 

 

MSB (BIN, HEX, DEC): 1000000 - 40 - 64

LSB (BIN, HEX, DEC): 0 - 0 - 0

DATA (BIN, HEX, DEC): 100000000000000 - 4000 - 16384

 

 

Temperature = 127.80 ºC

 

With a supply of 5V i'm getting this (while heating a little bit):


MSB (BIN, HEX, DEC): 1001 - 9 - 9

LSB (BIN, HEX, DEC): 1111010 - 7A - 122

DATA (BIN, HEX, DEC): 100101111010 - 97A - 2426

 

 

Temperature = 18.92 ºC

 

MSB (BIN, HEX, DEC): 1100 - C - 12

LSB (BIN, HEX, DEC): 11011100 - DC - 220

DATA (BIN, HEX, DEC): 110011011100 - CDC - 3292

 

Temperature = 19.53 ºC

 

(the problem)

 

MSB (BIN, HEX, DEC): 11010 - 1A - 26

LSB (BIN, HEX, DEC): 1001000 - 48 - 72

DATA (BIN, HEX, DEC): 1101001001000 - 1A48 - 6728

 

 

Temperature = 52.48 ºC

 

 

MSB (BIN, HEX, DEC): 11010 - 1A - 26

LSB (BIN, HEX, DEC): 111100 - 3C - 60

DATA (BIN, HEX, DEC): 1101000111100 - 1A3C - 6716

 

 

Temperature = 52.38 ºC

 

With this data can you help me to figured out what is the problem? Thanks.


Outcomes