From 698cf140661b0056e04d0f330c201a100a5c9dc0 Mon Sep 17 00:00:00 2001 From: Tobias Weber Date: Wed, 4 Sep 2013 14:38:46 +0200 Subject: [PATCH] Change Write Enable for DAC-SPI Interface --- mupix/sources/spi_if.vhd | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/mupix/sources/spi_if.vhd b/mupix/sources/spi_if.vhd index 537322f..36d1ba1 100644 --- a/mupix/sources/spi_if.vhd +++ b/mupix/sources/spi_if.vhd @@ -4,7 +4,7 @@ -- -- Niklaus Berger, Heidelberg University -- nberger@physi.uni-heidelberg.de ---Changed to TRB3 readout by T. Weber, University Mainz +-- Changed to TRB3 readout by T. Weber, University Mainz ----------------------------------------------------------------------------- library ieee; @@ -126,8 +126,7 @@ begin --TRB slave bus --x0040: Threshold-DAC Register 16 bits --x0041: Injection-DACs Register 32 bits - --x0042: WriteControl Register bit0: Write DACs - ----------------------------------------------------------------------------- + ----------------------------------------------------------------------------- SLV_HANDLER : process(clk) begin -- process SLV_HANDLER if rising_edge(clk) then @@ -135,18 +134,18 @@ begin SLV_UNKNOWN_ADDR_OUT <= '0'; SLV_NO_MORE_DATA_OUT <= '0'; SLV_ACK_OUT <= '0'; + wren <= '0'; if SLV_READ_IN = '1' then case SLV_ADDR_IN is when x"0040" => SLV_DATA_OUT <= x"0000" & threshold_reg; SLV_ACK_OUT <= '1'; + wren <= '1'; when x"0041" => SLV_DATA_OUT <= injection2_reg & injection1_reg; SLV_ACK_OUT <= '1'; - when x"0042" => - SLV_DATA_OUT(0) <= wren; - SLV_ACK_OUT <= '1'; + wren <= '1'; when others => SLV_UNKNOWN_ADDR_OUT <= '1'; end case; @@ -161,9 +160,6 @@ begin injection2_reg <= SLV_DATA_IN(31 downto 16); injection1_reg <= SLV_DATA_IN(15 downto 0); SLV_ACK_OUT <= '1'; - when x"0042" => - wren <= SLV_DATA_IN(0); - SLV_ACK_OUT <= '1'; when others => SLV_UNKNOWN_ADDR_OUT <= '1'; end case; -- 2.43.0