]> jspc29.x-matter.uni-frankfurt.de Git - trbnet.git/commitdiff
*** empty log message ***
authorhadeshyp <hadeshyp>
Fri, 17 Aug 2012 09:51:57 +0000 (09:51 +0000)
committerhadeshyp <hadeshyp>
Fri, 17 Aug 2012 09:51:57 +0000 (09:51 +0000)
special/spi_ltc2600.vhd
trb_net_onewire.vhd

index 766394ba5f2b169721b182ed195dbd35d8e2cd0e..57c3f70064b517c077b00d3c7ed32d7c5edbceaa 100644 (file)
@@ -42,6 +42,7 @@ architecture spi_ltc2600_arch of spi_ltc2600 is
   signal word_count : integer range 0 to 31;
   signal bit_count  : integer range 0 to 31;
   signal time_count : integer range 0 to 7;
+  signal readback   : std_logic_vector(31 downto 0);
   
   type fsm_t is (IDLE, WAIT_STATE, SET, FINISH);
   signal fsm_state : fsm_t;
@@ -81,6 +82,8 @@ begin
           BUS_DATA_OUT <= ram(addr);
         elsif BUS_ADDR_IN(0) = '1' then
           BUS_DATA_OUT <= ctrl_reg;
+        elsif BUS_ADDR_IN(1) = '1' then
+          BUS_DATA_OUT <= readback;
         else --if BUS_ADDR_IN(1) = '0' then
           BUS_DATA_OUT(15 downto 0) <= chipselect_reg;
           BUS_DATA_OUT(31 downto 16) <= x"0000";
@@ -139,11 +142,13 @@ begin
           end if;
         else
           fsm_state  <= WAIT_STATE;
+          readback   <= readback(30 downto 0) & SPI_SDI_IN;          
         end if;
       when FINISH =>
         if time_count = 0 and spi_sck = '0' then
           time_count <= 7;
           spi_sck    <= not spi_sck;
+          readback   <= readback(30 downto 0) & SPI_SDI_IN;          
         elsif time_count = 0 and spi_sck = '1' then
           fsm_state  <= IDLE;
         else
index 5d66d636e23d287d5a445bd8cb73313513254590..8c0c801b456e29a6a3f86497baed4488f57224dd 100644 (file)
@@ -49,7 +49,7 @@ architecture trb_net_onewire_arch of trb_net_onewire is
   signal recv_bit_ready, next_recv_bit_ready : std_logic;
   signal output_tmp, next_output_tmp : std_logic;
   signal word : std_logic_vector(15 downto 0);
-  signal ram_addr : std_logic_vector(2 downto 0);
+  signal ram_addr : std_logic_vector(2 downto 0) := "000";
   signal ram_wr : std_logic;
   signal send_rom, next_send_rom : std_logic;
   signal conv_temp, next_conv_temp : std_logic;