From 809b7372dc9fc71f818d57c8f8da193d8f4f751d Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Thu, 8 Oct 2015 13:02:43 +0000
Subject: [PATCH] Choose temp = 45 degrees so adc temp_data = 460.

---
 libraries/io/fpga_temp_sens/src/vhdl/fpga_temp_sens.vhd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libraries/io/fpga_temp_sens/src/vhdl/fpga_temp_sens.vhd b/libraries/io/fpga_temp_sens/src/vhdl/fpga_temp_sens.vhd
index 727e24c05c..a9e9142f02 100644
--- a/libraries/io/fpga_temp_sens/src/vhdl/fpga_temp_sens.vhd
+++ b/libraries/io/fpga_temp_sens/src/vhdl/fpga_temp_sens.vhd
@@ -91,7 +91,8 @@ BEGIN
 
 
   gen_no_tech_fpga_temp_sens: IF g_sim=TRUE GENERATE
-    temp_data <= RESIZE_UVEC(x"45",10);
+    -- temp = (708 * adc)/1024 - 273 => adc = (temp + 273)*1024/708
+    temp_data <= TO_UVEC(460, temp_data'LENGTH);   -- choose temp = 45 degrees so adc temp_data = 460
     mm_reg_temp_data <= RESIZE_UVEC(temp_data,c_mem_reg_dat_w);
   END GENERATE;
 
-- 
GitLab