entity ds18b20_ctrl is
port
(
clk : IN std_logic; -- 100mhz
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--
temp_sensor_id : OUT std_logic_vector(63 downto 0); -- Unique Serial Code
-- The default resolution at power-up is 12-bit.
temperature : OUT std_logic_vector(15 downto 0); -- -55°C to +125°C
-- The DS18B20 output temperature data is calibrated in degrees Celsius;
-- for Fahrenheit applications, a lookup table or conversion routine must
-- be used.
-- output * 0.0625 = output / 16 = temperature(11 downto 4)
--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--
temp_sensor_dq : INOUT std_logic := 'Z' -- 1-Wire Digital Thermometer
);
end ds18b20_ctrl;
--==============================================================================--
architecture Behavioral of ds18b20_ctrl is
--==============================================================================--
-- Constant Declarations
constant MAX_TPDTCT : integer := 100000; -- 1ms
constant MAX_TSTART : integer := 50000; -- 500us