Connecting temperature information to output of endpoint_full_handler_record.
LOCAL_TIME_OUT : out std_logic_vector(7 downto 0); --local time running with chip frequency
TIME_SINCE_LAST_TRG_OUT : out std_logic_vector(31 downto 0); --local time, resetted with each trigger
TIMER_TICKS_OUT : out std_logic_vector(1 downto 0); --bit 1 ms-tick, 0 us-tick
+ TEMPERATURE_OUT : out std_logic_vector(11 downto 0);
--Debugging & Status information
STAT_DEBUG_IPU : out std_logic_vector (31 downto 0);
STAT_DEBUG_1 : out std_logic_vector (31 downto 0);
signal ONEWIRE_DATA : std_logic_vector(15 downto 0);
signal ONEWIRE_ADDR : std_logic_vector(2 downto 0);
signal ONEWIRE_WRITE : std_logic;
+ signal buf_stat_onewire : std_logic_vector(31 downto 0);
signal buf_COMMON_STAT_REG_STROBE : std_logic_vector((std_COMSTATREG)-1 downto 0);
signal buf_COMMON_CTRL_REG_STROBE : std_logic_vector((std_COMCTRLREG)-1 downto 0);
REGIO_IDRAM_DATA_OUT <= (others => '0');
-
+ STAT_ONEWIRE <= buf_stat_onewire;
+
onewire_interface : trb_net_onewire
generic map(
USE_TEMPERATURE_READOUT => c_YES,
ADDR_OUT => ONEWIRE_ADDR,
WRITE_OUT=> ONEWIRE_WRITE,
TEMP_OUT => temperature,
- STAT => STAT_ONEWIRE
+ STAT => buf_stat_onewire
);
end generate;
gen_1wire_monitor : if REGIO_USE_1WIRE_INTERFACE = c_MONITOR generate
ADDR_OUT => ONEWIRE_ADDR,
WRITE_OUT=> ONEWIRE_WRITE,
TEMP_OUT => temperature,
- STAT => STAT_ONEWIRE
+ STAT => buf_stat_onewire
);
end generate;
end generate;
buf_COMMON_STAT_REG_IN(191 downto 184) <= buf_LVL1_TRG_CODE_OUT;
buf_COMMON_STAT_REG_IN(271 downto 192) <= stat_counters_lvl1_handler;
buf_COMMON_STAT_REG_IN(287 downto 272) <= (others => '0');
+ buf_COMMON_STAT_REG_IN(319 downto 288) <= buf_stat_onewire;
end process;
CTRL_REG_STROBE <= buf_CTRL_REG_STROBE;
TIMER_TICKS_OUT <= buf_TIMER_TICKS_OUT;
-
+ TEMPERATURE_OUT <= temperature;
+
buf_CTRL_GEN <= IOBUF_CTRL_GEN;
REGIO_COMMON_CTRL_REG_OUT <= buf_REGIO_COMMON_CTRL_REG_OUT;
TIME_LOCAL_OUT : out std_logic_vector ( 7 downto 0); --local time running with chip frequency
TIME_SINCE_LAST_TRG_OUT : out std_logic_vector (31 downto 0); --local time, resetted with each trigger
TIME_TICKS_OUT : out std_logic_vector ( 1 downto 0); --bit 1 ms-tick, 0 us-tick
+ TEMPERATURE_OUT : out std_logic_vector (11 downto 0);
--Debugging & Status information
STAT_DEBUG_IPU : out std_logic_vector (31 downto 0);
LOCAL_TIME_OUT => time_local_i,
TIME_SINCE_LAST_TRG_OUT => time_since_last_trg_i,
TIMER_TICKS_OUT => time_ticks_i,
+ TEMPERATURE_OUT => TEMPERATURE_OUT,
STAT_DEBUG_IPU => open,
STAT_DEBUG_1 => open,
signal time_local_i : std_logic_vector ( 7 downto 0);
signal time_since_last_trg_i : std_logic_vector (31 downto 0);
signal time_ticks_i : std_logic_vector ( 1 downto 0);
+ signal temperature_i : std_logic_vector (11 downto 0);
+
signal buf_fee_data_almost_full_out : std_logic_vector(DATA_INTERFACE_NUMBER-1 downto 0);
signal stat_handler_i : std_logic_vector (127 downto 0);
signal stat_data_buffer_level : std_logic_vector (DATA_INTERFACE_NUMBER*32-1 downto 0);
LOCAL_TIME_OUT => time_local_i,
TIME_SINCE_LAST_TRG_OUT => time_since_last_trg_i,
TIMER_TICKS_OUT => time_ticks_i,
+ TEMPERATURE_OUT => temperature_i,
STAT_DEBUG_IPU => open,
STAT_DEBUG_1 => open,
TIMERS_OUT.last_trigger <= time_since_last_trg_i;
TIMERS_OUT.tick_ms <= time_ticks_i(1);
TIMERS_OUT.tick_us <= time_ticks_i(0);
+TIMERS_OUT.temperature <= temperature_i;
---------------------------------------------------------------------------
-- RegIO Bus Handler
REGIO_ONEWIRE_MONITOR_OUT : out std_logic;\r
REGIO_VAR_ENDPOINT_ID : in std_logic_vector(15 downto 0) := (others => '0');\r
MY_ADDRESS_OUT : out std_logic_vector(15 downto 0);\r
- \r
+ TEMPERATURE_OUT : out std_logic_vector(11 downto 0);\r
GLOBAL_TIME_OUT : out std_logic_vector(31 downto 0); --global time, microseconds\r
LOCAL_TIME_OUT : out std_logic_vector(7 downto 0); --local time running with chip frequency\r
TIME_SINCE_LAST_TRG_OUT : out std_logic_vector(31 downto 0); --local time, resetted with each trigger\r
TIME_LOCAL_OUT : out std_logic_vector (7 downto 0); --local time running with chip frequency\r
TIME_SINCE_LAST_TRG_OUT : out std_logic_vector (31 downto 0); --local time, resetted with each trigger\r
TIME_TICKS_OUT : out std_logic_vector (1 downto 0); --bit 1 ms-tick, 0 us-tick\r
+ TEMPERATURE_OUT : out std_logic_vector(11 downto 0);\r
\r
--Debugging & Status information\r
STAT_DEBUG_IPU : out std_logic_vector (31 downto 0);\r
WRITE_START, WRITE_WAIT, READ_BIT, READ_READ_ROM, SEND_CONV_TEMP,
READ_CONV_TEMP, SEND_READ_TEMP, READ_READ_TEMP);
signal state, next_state : state_t;
+ signal state_bits : std_logic_vector(3 downto 0);
signal timecounter : integer range 0 to MAX_COUNTER;
signal bitcounter : integer range 0 to 127;
signal bitcounter_vector : std_logic_vector(6 downto 0);
end if;
end process;
+ state_bits <= x"0" when state = START else
+ x"1" when state = IDLE else
+ x"2" when state = SEND_RESET else
+ x"3" when state = WAIT_AFTER_RESET else
+ x"4" when state = SEND_ROM_COMMAND else
+ x"5" when state = READ_WAIT else
+ x"6" when state = WRITE_START else
+ x"7" when state = WRITE_WAIT else
+ x"8" when state = READ_BIT else
+ x"9" when state = READ_READ_ROM else
+ x"a" when state = SEND_CONV_TEMP else
+ x"b" when state = READ_CONV_TEMP else
+ x"c" when state = SEND_READ_TEMP else
+ x"d" when state = READ_READ_TEMP else
+ x"F";
+
STAT(0) <= '0';
STAT(1) <= '0' when input = '0' else '1';
STAT(6) <= reading_temp;
STAT(7) <= buf_STAT;
STAT(11 downto 8) <= bitcounter_vector(3 downto 0);
- STAT(31 downto 12) <= (others => '0');
+ STAT(15 downto 12)<= state_bits;
+ STAT(16)<= next_strong_pullup;
+ STAT(31 downto 17) <= (others => '0');
end architecture;
--common registers
--maximum: 4, because of regio implementation
- constant std_COMSTATREG : integer := 9;
+ constant std_COMSTATREG : integer := 10;
constant std_COMCTRLREG : integer := 3;
--needed address width for common registers
constant std_COMneededwidth : integer := 4;
tick_ms : std_logic;
tick_us : std_logic;
network_address : std_logic_vector (15 downto 0);
+ temperature : std_logic_vector (11 downto 0);
end record;
type MED2INT is record