1 |
2 |
idiolatrie |
--------------------------------------------------------------------------------
|
2 |
|
|
-- UART Transceiver 19200/8N1 --
|
3 |
|
|
--------------------------------------------------------------------------------
|
4 |
|
|
-- This minimal implementation of an Universal Asynchronous Receiver and --
|
5 |
|
|
-- Transmitter (UART) suits a baud rate of 19200 baud/sec as well as 8 bits --
|
6 |
|
|
-- of data, no parity bit and one stop bit configuration only. It comprises --
|
7 |
|
|
-- two seperate baud generators to receive and transmit simultanously. --
|
8 |
|
|
-- --
|
9 |
|
|
-- REFERENCES --
|
10 |
|
|
-- --
|
11 |
|
|
-- [1] Chu Pong P., FPGA Prototyping By VHDL Examples, --
|
12 |
|
|
-- John Wiley & Sons Inc., Hoboken, New Jersy, 2008, --
|
13 |
|
|
-- ISBN: 978-0470185315 --
|
14 |
|
|
-- --
|
15 |
|
|
--------------------------------------------------------------------------------
|
16 |
|
|
-- Copyright (C)2011 Mathias Hörtnagl <mathias.hoertnagl@gmail.comt> --
|
17 |
|
|
-- --
|
18 |
|
|
-- This program is free software: you can redistribute it and/or modify --
|
19 |
|
|
-- it under the terms of the GNU General Public License as published by --
|
20 |
|
|
-- the Free Software Foundation, either version 3 of the License, or --
|
21 |
|
|
-- (at your option) any later version. --
|
22 |
|
|
-- --
|
23 |
|
|
-- This program is distributed in the hope that it will be useful, --
|
24 |
|
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of --
|
25 |
|
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --
|
26 |
|
|
-- GNU General Public License for more details. --
|
27 |
|
|
-- --
|
28 |
|
|
-- You should have received a copy of the GNU General Public License --
|
29 |
|
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>. --
|
30 |
|
|
--------------------------------------------------------------------------------
|
31 |
|
|
library ieee;
|
32 |
|
|
use ieee.std_logic_1164.all;
|
33 |
|
|
use ieee.numeric_std.all;
|
34 |
|
|
|
35 |
|
|
library work;
|
36 |
|
|
use work.iwb.all;
|
37 |
|
|
|
38 |
|
|
package iuart is
|
39 |
|
|
|
40 |
|
|
component uartr is
|
41 |
|
|
port(
|
42 |
|
|
si : in slave_in_t;
|
43 |
|
|
so : out slave_out_t;
|
44 |
|
|
-- Non-Wishbone Signals
|
45 |
|
|
RS232_DCE_RXD : in std_logic
|
46 |
|
|
);
|
47 |
|
|
end component;
|
48 |
|
|
|
49 |
|
|
component uartt is
|
50 |
|
|
port(
|
51 |
|
|
si : in slave_in_t;
|
52 |
|
|
so : out slave_out_t;
|
53 |
|
|
-- Non-Wishbone Signals
|
54 |
|
|
RS232_DCE_TXD : out std_logic
|
55 |
|
|
);
|
56 |
|
|
end component;
|
57 |
|
|
|
58 |
|
|
component counter is
|
59 |
|
|
generic(
|
60 |
|
|
FREQ : positive := 50; -- Clock frequency in MHz.
|
61 |
|
|
RATE : positive := 19200 -- Baud rate.
|
62 |
|
|
);
|
63 |
|
|
port(
|
64 |
|
|
clk : in std_logic;
|
65 |
|
|
rst : in std_logic;
|
66 |
|
|
tick : out std_logic
|
67 |
|
|
);
|
68 |
|
|
end component;
|
69 |
|
|
end iuart;
|