- 博客(0)
- 资源 (3)
- 收藏
- 关注
Uart IP core
串行通信IP核 用于FPGA
-- File Name: Baud_rate_generator.vhd
-- Function: Baud rate generator for uart communication
-- System clock:32MHz
-- ************************************************************
-- 7.2 Build 11/02/2009 Full Version 1.0
-- Copyright for limang
-- ************************************************************
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
-- ************************************************************
-- Port Description
-- clk: System clock
-- data: Decision the Baud rate
-- uart_clk: Clock output for uart
-- ************************************************************
entity Baud_rate_generator is
port
(
clk:in std_logic;
data:in std_logic_vector (3 downto 0);
uart_clk:out std_logic
);
end entity Baud_rate_generator;
--***********************
-- Baud_rate for input
--***********************
--| data | Baud_rate |
--| 0000 | 1200 |
--| 0001 | 2400 |
--| 0010 | 4800 |
--| 0011 | 9600 |
--| 0100 | 14400 |
--| 0101 | 19200 |
--| 0110 | 28800 |
--| 0111 | 38400 |
--| 1000 | 57600 |
--| 1001 | 115200 |
--|others| for updata |
--***********************
architecture behave of Baud_rate_generator is
constant system_clock:integer:=32e6;
signal divisor:integer range 4444 downto 46;
signal cnt:integer range 4444 downto 0:=0;
signal clk_tmp:std_logic;
begin
process(data)
begin
case data is
when "0000" => divisor divisor divisor divisor divisor divisor divisor divisor divisor divisor null;
end case;
end process;
process(clk)
begin
if clk'event and clk='1' then
cnt<=cnt
2009-11-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人