From b42e579658559018a641329b086aa27dbf63ff5c Mon Sep 17 00:00:00 2001 From: Tobias Weber Date: Mon, 13 Oct 2014 16:58:26 +0100 Subject: [PATCH] Seperate address for second injection DAC register --- mupix/sources/spi_if.vhd | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/mupix/sources/spi_if.vhd b/mupix/sources/spi_if.vhd index d3c00d9..e3058fb 100644 --- a/mupix/sources/spi_if.vhd +++ b/mupix/sources/spi_if.vhd @@ -44,8 +44,8 @@ architecture rtl of spi_if is signal ckdiv : unsigned(5 downto 0); signal injection2_reg : std_logic_vector(15 downto 0) := (others => '0'); - signal injection1_reg : std_logic_vector(15 downto 0); - signal threshold_reg : std_logic_vector(15 downto 0); + signal injection1_reg : std_logic_vector(15 downto 0) := (others => '0'); + signal threshold_reg : std_logic_vector(15 downto 0) := (others => '0'); signal wren : std_logic; @@ -142,7 +142,10 @@ begin SLV_DATA_OUT <= x"0000" & threshold_reg; SLV_ACK_OUT <= '1'; when x"0041" => - SLV_DATA_OUT <= injection2_reg & injection1_reg; + SLV_DATA_OUT <= x"0000" & injection1_reg; + SLV_ACK_OUT <= '1'; + when x"0042" => + SLV_DATA_OUT <= x"0000" & injection2_reg; SLV_ACK_OUT <= '1'; when others => SLV_UNKNOWN_ADDR_OUT <= '1'; @@ -156,7 +159,10 @@ begin SLV_ACK_OUT <= '1'; wren <= '1'; when x"0041" => - injection2_reg <= SLV_DATA_IN(31 downto 16); + injection1_reg <= SLV_DATA_IN(15 downto 0); + SLV_ACK_OUT <= '1'; + wren <= '1'; + when x"0042" => injection1_reg <= SLV_DATA_IN(15 downto 0); SLV_ACK_OUT <= '1'; wren <= '1'; -- 2.51.0