OpenCores
URL https://opencores.org/ocsvn/uart2bus/uart2bus/trunk

Subversion Repositories uart2bus

[/] [uart2bus/] [trunk/] [vhdl/] [rtl/] [uartTx.vhd] - Diff between revs 11 and 13

Show entire file | Details | Blame | View Log

Rev 11 Rev 13
Line 2... Line 2...
-- uart transmit module  
-- uart transmit module  
--
--
-----------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
library ieee;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.numeric_std.all;
 
 
entity uartTx is
entity uartTx is
  port ( clr       : in  std_logic;                    -- global reset input
  port ( clr       : in  std_logic;                    -- global reset input
         clk       : in  std_logic;                    -- global clock input
         clk       : in  std_logic;                    -- global clock input
         ce16      : in  std_logic;                    -- baud rate multiplyed by 16 - generated by baud module
         ce16      : in  std_logic;                    -- baud rate multiplyed by 16 - generated by baud module
Line 30... Line 30...
    begin
    begin
      if (clr = '1') then
      if (clr = '1') then
        count16 <= (others => '0');
        count16 <= (others => '0');
      elsif (rising_edge(clk)) then
      elsif (rising_edge(clk)) then
        if ((iTxBusy = '1') and (ce16 = '1')) then
        if ((iTxBusy = '1') and (ce16 = '1')) then
          count16 <= count16 + 1;
          count16 <= std_logic_vector(unsigned(count16) + 1);
        elsif (iTxBusy = '0') then
        elsif (iTxBusy = '0') then
          count16 <= (others => '0');
          count16 <= (others => '0');
        end if;
        end if;
      end if;
      end if;
    end process;
    end process;
Line 56... Line 56...
    begin
    begin
      if (clr = '1') then
      if (clr = '1') then
        bitCount <= (others => '0');
        bitCount <= (others => '0');
      elsif (rising_edge(clk)) then
      elsif (rising_edge(clk)) then
        if ((iTxBusy = '1') and (ce1 = '1')) then
        if ((iTxBusy = '1') and (ce1 = '1')) then
          bitCount <= bitCount + 1;
          bitCount <= std_logic_vector(unsigned(bitCount) + 1);
        elsif (iTxBusy = '0') then
        elsif (iTxBusy = '0') then
          bitCount <= (others => '0');
          bitCount <= (others => '0');
        end if;
        end if;
      end if;
      end if;
    end process;
    end process;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.