cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
2,231 Views
Registered: ‎06-16-2017

XADC temp conversion

Jump to solution

Hi,

 

I instantiated the xadc_wiz IP in an XC7Z007S.  In software, I am reading a 12-bit value from the temperature register of this peripheral but I don't know how to convert that to celcius.  At approximately room temperature (when I first power up the device), I am reading typical values of 0x9D00.

 

xil_printf("temp=%x\n\r", Xil_In32(XADC + 0x200));

 

Thanks,
Dan

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Contributor
Contributor
3,057 Views
Registered: ‎06-16-2017

Well, I guess I'll answer my own question.  Yes - you do ignore the lower 4-bits.  My temperature conversion worked perfectly after I shifted the value right by 4.

View solution in original post

0 Kudos
4 Replies
Highlighted
Scholar
Scholar
2,222 Views
Registered: ‎02-27-2008

Page 23, Temperature Sensor.

 

UG480_7,

 

 

Austin Lesea
Principal Engineer
Xilinx San Jose
Highlighted
Contributor
Contributor
2,208 Views
Registered: ‎06-16-2017

Hi Austin,

 

Thanks for the response. I'm still confused about the output from the XADC.  When I read the temperature register, the value that I read back is (typically) 0x0000afe8.  Obviously, this is not the 12-bit number that I am expecting.  What am I missing here?  Am I supposed to used the most significant 12 bits of this value and ignore the lower 4?

 

Thanks,
Dan

 

0 Kudos
Highlighted
Contributor
Contributor
3,058 Views
Registered: ‎06-16-2017

Well, I guess I'll answer my own question.  Yes - you do ignore the lower 4-bits.  My temperature conversion worked perfectly after I shifted the value right by 4.

View solution in original post

0 Kudos
Highlighted
Scholar
Scholar
2,152 Views
Registered: ‎02-27-2008

Yes,

 

The converter actually has 16 bits, but the lower 4 bits are too noisy for any real use.  I suppose you could average many values to reduce the noise, but that fine a resolution for temperature is silly:  the accuracy, process, voltage, and temperature drift would make the information pretty useless.  It might make a good random number generator, though.

Austin Lesea
Principal Engineer
Xilinx San Jose