0% found this document useful (0 votes)
64 views1 page

STD - Logic STD - Logic - Vector STD - Logic STD - Logic

This document describes an implementation of a UART transmitter (UART_TX) in VHDL. It contains the entity and architecture for a UART_TX module that takes in start, data and clock signals and outputs a transmit signal. The architecture implements controls for communication, anti-bouncing of buttons, baud rate counting and sending of each bit in the data.

Uploaded by

uly14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views1 page

STD - Logic STD - Logic - Vector STD - Logic STD - Logic

This document describes an implementation of a UART transmitter (UART_TX) in VHDL. It contains the entity and architecture for a UART_TX module that takes in start, data and clock signals and outputs a transmit signal. The architecture implements controls for communication, anti-bouncing of buttons, baud rate counting and sending of each bit in the data.

Uploaded by

uly14
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

1 ----------------------------------------------------------------------------------

2 -- ASIGNATURA: DISPOSITIVOS LOGICOS PROGRAMABLES


3 -- DOCENTE: CESAR VÁZQUEZ CIANCA
4 -- DESCRIPCIÓN: IMPLEMENTACIÓN UART TX
5 ----------------------------------------------------------------------------------
6 library IEEE;
7 use IEEE.STD_LOGIC_1164.ALL;
8
9 entity UART_TX is
10 Port ( START : in STD_LOGIC;
11 DATO : in STD_LOGIC_VECTOR (7 downto 0);
12 CLK : in STD_LOGIC;
13 OUT_TX : out STD_LOGIC);
14 end UART_TX;
15
16 architecture Behavioral of UART_TX is
17 -- CONTROL DE COMUNICACIÓN
18 SIGNAL INICIO : STD_LOGIC;
19
20 -- SEÑALES ANTI REBOTE
21 SIGNAL START_ANT: STD_LOGIC;
22 SIGNAL START_FIX, START_FIX_ANT: STD_LOGIC;
23 SIGNAL COUNT_REBOTE: INTEGER RANGE 0 TO 500000;
24 -- CUENTA DE VELOCIDAD
25 SIGNAL BAUDIOS: INTEGER RANGE 0 TO 5200;
26 -- No DE BIT A ENVIAR
27 SIGNAL NBIT: INTEGER RANGE 0 TO 11;
28
29 begin
30 -- DETECTAR PULSO EN START
31 START_ANT <= START WHEN CLK'EVENT AND CLK='1';
32
33 -- ANTI-REBOTE BOTÓN START
34 COUNT_REBOTE <= 0 WHEN ((START_ANT='0' AND START='1') OR (START_ANT='1' AND START='0'))
35 OR COUNT_REBOTE = 500000 ELSE
36 COUNT_REBOTE+1 WHEN CLK'EVENT AND CLK='1';
37
38 START_FIX <= START WHEN COUNT_REBOTE = 499999 AND CLK'EVENT AND CLK='1';
39 START_FIX_ANT <= START_FIX WHEN CLK'EVENT AND CLK='1';
40
41 -- INICIO
42 INICIO <= '0' WHEN NBIT=11 ELSE
43 '1' WHEN START_FIX_ANT='0' AND START_FIX='1' AND CLK'EVENT AND CLK='1';
44
45 -- TIEMPO BAUDIOS
46 BAUDIOS <= 0 WHEN INICIO = '0' OR BAUDIOS = 5200 ELSE
47 BAUDIOS+1 WHEN CLK'EVENT AND CLK='0';
48
49 -- ENVIO DATOS
50 OUT_TX <= '1' WHEN NBIT = 0 ELSE
51 '0' WHEN NBIT = 1 ELSE
52 DATO(0) WHEN NBIT = 2 ELSE
53 DATO(1) WHEN NBIT = 3 ELSE
54 DATO(2) WHEN NBIT = 4 ELSE
55 DATO(3) WHEN NBIT = 5 ELSE
56 DATO(4) WHEN NBIT = 6 ELSE
57 DATO(5) WHEN NBIT = 7 ELSE
58 DATO(6) WHEN NBIT = 8 ELSE
59 DATO(7) WHEN NBIT = 9 ELSE
60 '0';
61
62 -- SIGUIENTE BIT
63 NBIT <= 0 WHEN INICIO = '0' ELSE
64 NBIT+1 WHEN BAUDIOS = 5199 AND CLK'EVENT AND CLK='1';
65
66 end Behavioral;

You might also like