Xilinx XADC Part3 : Internal temperature sensor
The XADC contains a number of sensors in addition to the analog input channels, these sensors are the power supply sensors and the temperature sensor.
These sensors can be used to generate an alarm signal at certain thresholds or it can be used to read the value of the supply voltages and the internal temperature of the chip.
In some applications it is required to monitor the supply voltages and the internal chip temperature to make sure that the chip is not exposed to abnormal operating conditions (which may indicate a hacking trial). In this case the internal supply voltages and temperature can be monitored when the chip is running the design under normal operating conditions, then the recorded sensor values can be used later to generate an alarm signal when the sensed values exceeds the predetermined values.
In this post we will show an example of monitoring the internal FPGA temperature using the XADC sensor before we start it should be noted that the data read from the XADC in 12-bits doesn't represent the read temperature in Celsius directly, the following transfer function shall be used :
Therefore a VHDL file is created to perform the transfer function.
1- In the Vivado block design add XADC IP.
2- double click on the IP and select DRP in the interface options and single channel in the startup channel selection.
3- in the single channel tab choose Temperature
4- connect the eoc_out to the den_in also connect constant zero to daddr_in, di_in and dwe_in.
5- connect a slice IP to extract the 12 most significant bits from the XADC output.
6- The following VHDL codes are used to perform the transfer function, the binary to BCD conversion and the seven segment display.
- Transfer function in VHDL code :
- Data Multiplexer :
- Seven segment display code :
7- Right click on the VHDL files and add it to the block design then connect all the components as follow
8- The internal temperature of the chip is displayed on the seven segment display
I hope that was helpful please write down questions and/or suggestions in the comments