]> jspc29.x-matter.uni-frankfurt.de Git - padiwa.git/commitdiff
few bugfixes to USB sctrl
authorJan Michel <jan@mueschelsoft.de>
Thu, 10 Apr 2014 12:50:07 +0000 (14:50 +0200)
committerJan Michel <jan@mueschelsoft.de>
Thu, 10 Apr 2014 12:50:07 +0000 (14:50 +0200)
pulser/padiwa_pulser.vhd
source/uart_rec.vhd
source/uart_sctrl.vhd
source/uart_trans.vhd

index dc062fe0ac2f47f56bd4de619dc324dc1b8e7a5c..d53a57e64d316561ac2bc8ffc2912e5686c6c592 100644 (file)
@@ -98,11 +98,11 @@ THE_UART : entity work.uart_sctrl
 
 PROC_REGISTERS : process begin
   wait until rising_edge(clk_i);
-  if WRITE_IN = '1' then
+  if bus_write= '1' then
     if uart_addr = x"01" then
       lcd_data_i(31 downto 0) <= uart_rx_data;
     elsif uart_addr = x"02" then
-      lcd_data_i(79 downto 64) <= uart_rx_data;
+      lcd_data_i(79 downto 64) <= uart_rx_data(15 downto 0);
     end if;
   end if;
 end process;
index 28a9f1ce4068e3df294dd8fc1c8a8778337e047e..5edbaf06d05ea543ca19d98c4743efa3210fceb1 100644 (file)
@@ -73,10 +73,10 @@ DEBUG(3) <= '0';
   clock_division : process begin
     wait until rising_edge(CLK);
     -- scaling down the main clock to the desired baudrate
-    if clk_div_counter < CLK_DIV-1 then
-      clk_div_counter <= clk_div_counter + 1;
-    else
+    if clk_div_counter = CLK_DIV-1 then
       clk_div_counter <= x"0000";
+    else
+      clk_div_counter <= clk_div_counter + 1;
     end if;
     -- generates symbol_pulse, a signal that has 1 clock cycle pulses, one symbol duration period apart 
     -- in contrast to the transceiver module, the symbol pulse is generated in the middle of the
index c4b622181159bc8f8dd4d565659ecc7b861165ab..380b7586b65ce8efdcf8cba4b6914ef03f66a7d2 100644 (file)
@@ -39,7 +39,7 @@ signal rx_ready  : std_logic;
 signal tx_send   : std_logic;
 signal tx_ready  : std_logic;
 
-type   rx_state_t is (IDLE,ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2);
+type   rx_state_t is (IDLE,GET_ADDR,GET_BYTE0,GET_BYTE1,GET_BYTE2,GET_BYTE3,DO_WRITE,DO_READ,SEND_BYTE0,SEND_BYTE1,SEND_BYTE2);
 signal state     : rx_state_t;
 signal addr      : std_logic_vector(7 downto 0) := (others => '0');
 signal word      : std_logic_vector(31 downto 0) := (others => '0');
@@ -82,7 +82,7 @@ PROC_RX : process begin
       cmd_rd <= '0';
       cmd_wr <= '0';
       if rx_ready = '1' then
-        state <= ADDR;
+        state <= GET_ADDR;
         if rx_data = x"52" then
           cmd_rd <= '1';
         elsif rx_data = x"57" then
@@ -92,7 +92,7 @@ PROC_RX : process begin
         end if;
       end if;
 
-    when ADDR  =>
+    when GET_ADDR  =>
       if rx_ready = '1' then
         addr <= rx_data;
         if cmd_wr = '1' then
index c50dc0af196d7122550a0d54afdc5a7b824c175d..8b5afbb104fdf44f4f3913984674f91a60dcb2d8 100644 (file)
@@ -77,10 +77,10 @@ DEBUG(3) <= '0';
   clock_division : process begin
     wait until rising_edge(CLK);
     -- scaling down the main clock to the desired baudrate
-    if clk_div_counter < CLK_DIV-1 then
-      clk_div_counter <= clk_div_counter + 1;
-    else
+    if clk_div_counter = CLK_DIV-1 then
       clk_div_counter <= x"0000";
+    else
+      clk_div_counter <= clk_div_counter + 1;
     end if;