10-11-2017 08:27 AM
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
10-11-2017 05:54 PM
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.
10-11-2017 09:12 AM
Page 23, Temperature Sensor.
UG480_7,
10-11-2017 09:51 AM
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
10-11-2017 05:54 PM
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.
10-12-2017 07:05 AM
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.