]> rtime.felk.cvut.cz Git - fpga/uart.git/blobdiff - uart.vhd
Resets changed from asynchronous to synchronous.
[fpga/uart.git] / uart.vhd
index 09450f91f1bc0ada7428853220b7ad17ca45573b..da189c487fe6fd12e3d6f496011b35fbc79b79c6 100644 (file)
--- a/uart.vhd
+++ b/uart.vhd
@@ -284,21 +284,23 @@ begin
   
   process (mclk, puc) is
   begin
-    if puc = '1' then
-      reg_baud <= (others => '0');
-      reg_ie   <= (others => '0');
-      
-    elsif mclk'event and mclk = '1' then
-      if reg_we (UBAUD) = '1' then
-        reg_baud (7 downto 0) <= per_din_low;
-      end if;
+    if mclk'event and mclk = '1' then
+      if puc = '1' then
+        reg_baud <= (others => '0');
+        reg_ie   <= (others => '0');
+
+      else
+        if reg_we (UBAUD) = '1' then
+          reg_baud (7 downto 0) <= per_din_low;
+        end if;
 
-      if reg_we (UBAUD+1) = '1' then
-        reg_baud (15 downto 8) <= per_din_high;
-      end if;
+        if reg_we (UBAUD+1) = '1' then
+          reg_baud (15 downto 8) <= per_din_high;
+        end if;
 
-      if reg_we (USTAT) = '1' then
-        reg_ie <= per_din_low;
+        if reg_we (USTAT) = '1' then
+          reg_ie <= per_din_low;
+        end if;
       end if;
     end if;
   end process;