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

## XADC temp conversion

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

1 Solution

Accepted Solutions
Highlighted
Contributor
3,106 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.

4 Replies
Highlighted
Scholar
2,271 Views
Registered: ‎02-27-2008

Page 23, Temperature Sensor.

UG480_7,

Austin Lesea
Principal Engineer
Xilinx San Jose
Highlighted
Contributor
2,257 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

Highlighted
Contributor
3,107 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.

Highlighted
Scholar
2,201 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