![Page 1: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/1.jpg)
Introducción a las
Interfaces de entrada / salida
![Page 2: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/2.jpg)
Puerto de Salida Básico
#OE
Salidas
Registro (Latch)
Bus de Datos del Sistema
CLK#WR
#CE
D0
D7
Q0
Q7
![Page 3: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/3.jpg)
Entity Salida is
port (
HCLK : in std_logic;RESET : in std_logic;CS : in std_logic;WR : in std_logic;D : in std_logic_vector (7 downto 0);
--Bus datos es siempre entrada
O : out std_logic_vector (7 downto 0) --Salidas al exterior
);
end Salida;
Sintesis en vhdl de un puerto de salida
![Page 4: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/4.jpg)
architecture B2 of Salida isbegin
process (HCLK, RESET)begin
if RESET = '1' thenO ( 7 downto 0 )<= "00000000";
elseif HCLK = '1' and HCLK'event then -- Flanco de ascendente if CS = '0' then
if WR = '0' thenO (7 downto 0) <= D ( 7 downto 0 );
end if; end if;end if;
end if;
end process;end B2;
![Page 5: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/5.jpg)
Estimulo para test del puerto de salida
![Page 6: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/6.jpg)
Simulación – Puerto de salida
![Page 7: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/7.jpg)
Puerto de Entrada Básico
#OE
Entradas
Puerta de 3 estados(Transceiver)
Bus de Datos del Sistema
#CE#RD
O0
O7
I0
I7
![Page 8: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/8.jpg)
entity Entrada is
port (
HCLK : in std_logic;RESET : in std_logic;
CS : in std_logic;RD : in std_logic;D : out std_logic_vector (7 downto 0);
-- Bus Datos es siempre salida
I : in std_logic_vector (7 downto 0) -- Entradas externas
);
end Entrada;
Sintesis en vhdl de un puerto de entrada
![Page 9: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/9.jpg)
architecture B2 of Entrada isBeginprocess (HCLK, RESET)Beginif RESET = '1' then
D ( 7 downto 0 )<= "ZZZZZZZZ";else
if HCLK = '1' and HCLK'event then -- Flanco de ascendenteif CS = '0' then -- Acceso al registro solo si CS es 0
if RD = '0' thenD ( 7 downto 0 ) <= I (7 downto 0);
elseD ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si RD esta en 1 el bus esta en "Z"
end if;else
D ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si CS esta en 1 el bus esta en "Z"
end if;end if;
end if;end process;end B2;
![Page 10: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/10.jpg)
Estimulo – Puerto de entrada
![Page 11: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/11.jpg)
Simulación – Puerto de entrada
![Page 12: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/12.jpg)
Aplicación
8.
8.
8.
8.
Habilitaciones(Cátodos)
Excitación(Ánodos)
K3K2K1K0
OE
CLK
CE1
WH
D15…D8
OE
CLK
CE1
WL
D7…D0
Q7
Q0
Q0
Q3
Puerto “A”
Puerto “B”
![Page 13: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/13.jpg)
a
c
b
d
e
gf
p
![Page 14: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/14.jpg)
CÁTODO COMÚNÁNODOS
ÁNODOS
![Page 15: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/15.jpg)
abcdefgp
Vcc
ÁNODOS
CÁTODO COMÚN
![Page 16: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/16.jpg)
5.
8.
8.
8.
ÁNODOS
ULN2003
KHH KLLKMH KML
1 0 0 0
![Page 17: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/17.jpg)
8.
3.
8.
8.
ÁNODOS
ULN2003
KLLKMH KML
0 1 0 0
![Page 18: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/18.jpg)
8.
8.
9.
8.
ÁNODOS
ULN2003
KLLKMH KML
0 0 1 0
![Page 19: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/19.jpg)
8.
8.
8.
6.
ÁNODOS
ULN2003
KLLKMH KML
0 0 0 1
![Page 20: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/20.jpg)
;Subrutina DISP;Variables utilizadas:
;STATUS : Próximo dígito de Buffer que es necesario refrescar;BUFFER : Tabla de 8 bytes que contiene los datos para el display y
los códigos de habilitación correspondientes
STATUS dw 0BUFFER db 1, 1 ;LSD , 00000001
db 3, 2 ; , 00000010 db 5, 4 ; , 00000100db 7, 8 ;MSD; 00001000
;PORT_A : Etiqueta que especifica la dirección del puerto del display
PORT_A equ XXXX
![Page 21: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/21.jpg)
;Subrutina DISP;Variables utilizadas:
;STATUS : Próximo dígito de Buffer que es necesario refrescar;BUFFER : Tabla de 8 bytes que contiene los datos para el display y
los códigos de habilitación correspondientes
STATUS dw 0BUFFER db 1, 1 ;LSD , 00000001
db 3, 2 ; , 00000010 db 5, 4 ; , 00000100db 7, 8 ;MSD; 00001000
;PORT_A : Etiqueta que especifica la dirección del puerto del display
PORT_A equ XXXX
1
1 = 00000001
3
2 = 00000010
5
4 = 00000100
8 =00001000
7
BUFFER
0
0
STATUS
OFFSET
incrementa
![Page 22: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/22.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN BUFFERMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET
![Page 23: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/23.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN BUFFERMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET
![Page 24: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/24.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN BUFFERMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET 1
1 = 00000001
3
2 = 00000010
5
4 = 00000100
8 =00001000
7
OFFSET BUFFER
STATUS
![Page 25: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/25.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN TRABLAMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET
![Page 26: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/26.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN TRABLAMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET
![Page 27: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/27.jpg)
;SUB. DE REFRESCO------------
DISP PROC NEAR
XOR AX,AXMOV DX, PORT_AOUT DX,AX ;APAGA DISPLAY
MOV BX, STATUS ;BUSCA DATOS EN TRABLAMOV SI, OFFSET BUFFERMOV AX,(BX+SI)OUT DX,AX ;ENCIENDE DIGITO
ADD BX, 2 ;APUNTA AL PROXIMO DIGITO EN MEMORIAAND BX, 7MOV STATUS,BXRET
![Page 28: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/28.jpg)
F0
F1
F2
F3
C0C1
C2C3
Teclado
TeclasSalidas
Entradas
![Page 29: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/29.jpg)
0
1
0
0
00
00
TECLADO
Salidas
Entradas
![Page 30: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/30.jpg)
0
0
0
01
00
TECLADO
1Salidas
Entradas
![Page 31: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/31.jpg)
0
1
0
0
00
00
TECLADO
Salidas
Entradas
![Page 32: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/32.jpg)
0
1
0
0
00
00
TECLADO
Salidas
Entradas
![Page 33: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/33.jpg)
F0
F1
F2
F3
C0C1
C2C3
Teclado
TeclasSalidas
Entradas
![Page 34: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/34.jpg)
Aplicación
8.
8.
8.
8.
Habilitaciones(Cátodos)
Excitación(Ánodos)
K3K2K1K0
OE
CLK
CE1
WH
D15…D8
OE
CLK
CE1
WL
D7…D0
Q7
Q0
Q0
Q3
![Page 35: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/35.jpg)
Q0
Q1
Q2
Q3
C0C1
C2C3
Teclado
Teclas
Entradas
![Page 36: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/36.jpg)
Q0
Q1
Q2
Q3
I0I1
I2I3
Teclado
Teclas
PUERTO
B
Entradas
![Page 37: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/37.jpg)
PUERTO_C
OE1
Entradas
Puerta de 3 estados
RDL
CE
O0
O7
I0
I7
OE2
D0
D7
![Page 38: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/38.jpg)
Q0
Q1
Q2
Q3
I3 I2 I1 I0 I4 I5 I6 I7
Teclado
Teclas
PUERTO
B
EntradasPUERTO_C
![Page 39: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/39.jpg)
;SUB. DE EXPLORACION DE TECLADO
SCAN PROC NEAR
MOV DX, PORT_BIN AL, DXTEST AL, 0F0hJZ notecMOV TECLA, AL
notec:RET
Subrutina SCAN :Variables utilizadas :
TECLA : Código ultima tecla presionada
TECLA db 0
![Page 40: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/40.jpg)
entity Registro is
port (
HCLK : in std_logic;RESET : in std_logic;CS : in std_logic;RD : in std_logic;WR : in std_logic;D : inout std_logic_vector (7 downto 0)
-- Bus de datos es Entrada/Salida
);
end Registro;
Síntesis en vhdl de un registro interno (sin líneas de entrada ni salida)
Registros internos
![Page 41: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/41.jpg)
architecture B2 of Registro isBeginprocess (HCLK, RESET)variable REGISTRO : std_logic_vector (7 downto 0) := "00000000";Beginif RESET = '1' then
D ( 7 downto 0 )<= "ZZZZZZZZ";else if HCLK = '1' and HCLK'event then -- Flanco de ascendente if CS = '0' then -- Acceso al registro solo si CS es 0 if RD = '0' then
D ( 7 downto 0 ) <= REGISTRO (7 downto 0); else
D ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si RD = 1, bus en "Z" if WR = '0' then
REGISTRO (7 downto 0) := D ( 7 downto 0 ); end if;
end if; else D ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si CS = 1, bus en "Z" end if; end if;end if;end process;end B2;
![Page 42: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/42.jpg)
Estímulo para test de registro interno
![Page 43: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/43.jpg)
Salida del test de registro interno
![Page 44: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/44.jpg)
Generador PWM
#OE
Salida
Registro
Bus de Datos del Sistema
CLK#CE#WR
D0
D7
Q0
Q7
CLK Q0
Q7
HCLK
ContadorComparador
PWM =1 siRegistro > Contador
![Page 45: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/45.jpg)
entity PWM isport (
HCLK : in std_logic;
RESET : in std_logic;
CS : in std_logic;RD : in std_logic;WR : in std_logic;D : inout std_logic_vector (7 downto 0);
PWM : out std_logic);
end PWM;
Síntesis VHDL de Generador PWM
![Page 46: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/46.jpg)
architecture B2 of PWM isBeginprocess (HCLK, RESET)variable REGISTRO : std_logic_vector (7 downto 0) := "00000000";variable CICLO : std_logic_vector (7 downto 0) := "00000000";variable CONTADOR : std_logic_vector (7 downto 0) := "00000000";Beginif RESET = '1' then D ( 7 downto 0 )<= "ZZZZZZZZ"; PWM <= '0';else if HCLK = '1' and HCLK'event then -- Flanco de ascendente
if CS = '0' then -- Acceso al registro solo si CS es 0if RD = '0' then D ( 7 downto 0 ) <= REGISTRO (7 downto 0);else D ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si RD es 1 el bus es "Z" if WR = '0' then
REGISTRO (7 downto 0) := D ( 7 downto 0 ); end if;end if;
elseD ( 7 downto 0 ) <="ZZZZZZZZ"; -- Si CS es 1 el bus es "Z"
end if;
![Page 47: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/47.jpg)
CONTADOR := CONTADOR +1; if CONTADOR > CICLO then PWM <= '0'; else PWM <= '1'; end if; if CONTADOR = "00000000" then CICLO := REGISTRO; end if;end if;end process;
end B2;
![Page 48: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/48.jpg)
Test de puerto PWM
![Page 49: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/49.jpg)
#OE
Salida
Entrada
Registro (Latch)
Puerta de 3 estados(Transceiver)
#WR
#CE
#RD
Puerto de Entrada + Salida Básico
Bus de Datos
#OE
Puertos programables, líneas de control
![Page 50: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/50.jpg)
#OE
Salida
Entrada
Registro (Latch)
Puerta de 3 estados(Transceiver)
#WR
#CE
#RD
Puerto de Entrada + Salida Básico
Bus de Datos
#OE
Puertos programables, lineas de control
![Page 51: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/51.jpg)
Salida
Entrada
Puerta de 3 estados(Transceiver)
Bus de Datos
Puerto de Entrada / Salida Programable
Registro(Latch)
Exterior#OE
#WR
#CE
#RD#OE
![Page 52: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/52.jpg)
#OE
Salida
Entrada
Bus de Datos
#WR
#CE
#RD
#OE#WR
#CE 1
#OE
Exterior
Puerto de Entrada / Salida Programable
![Page 53: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/53.jpg)
#OE
Salida
Entrada
Bus de Datos
#WR
#CE
#RD
#OE#WR
A0
#OE
Exterior
Puerto de Entrada / Salida Programable
![Page 54: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/54.jpg)
#CE #WR A0 #RD
Bus de Datos
Lógica de control de lectura y escritura (LCLE)
#OE
Salida
Entrada
#OE
#OE
Exterior
Puerto de Entrada / Salida Programable
![Page 55: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/55.jpg)
Bus de Datos
Lógica de control de lectura y escritura (LCLE)
#OE
Salida
Entrada
#OE
#OE
Exterior
Puerto de Entrada / Salida Programable
#CE #WR A0 #RD
![Page 56: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/56.jpg)
#OE
Salida
EntradaBus de Datos del sistema
#OELCLE
#OE
Puerta bidireccional de 3 estados (Transceiver)
#OE Dd
Puerto de Entrada / Salida Programable
#CE #WR A0 #RD
![Page 57: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/57.jpg)
#OE
Salida
EntradaBus de Datos del sistema
Puerto de Entrada / Salida Programable con Reset
#OELCLE
#OE
Puerta bidireccional de 3 estados (Transceiver)
RESET
#OE Dd
#CE #WR A0 #RD
![Page 58: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/58.jpg)
#OE
Salida
EntradaBus de Datos del sistema
#OELCLE
#OE
Puerta bidireccional de 3 estados (Transceiver)
RESET
Puerto de Entrada / Salida Programable con Reset
#OE Dd
#CE #WR A0 #RD
![Page 59: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/59.jpg)
#OE
Entrada
#OE
1
DQ
#R
INTR
Bus de Datos
Puertas de 3 estados(Transceiver)
Habilitación
Bandera
Puerto de E / S con Pedido de Atención y Bandera
![Page 60: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/60.jpg)
#OE
Entradas
Puerto de Entrada con Líneas de control y con capacidad de solicitar interrupciones
#OE
1
DQ
#R
INTR
Bu
s d
e D
ato
s
Ha
bili
taci
ón
Bandera
#CE A0#WR#RD
LCLE
#OE0
#OE0
DAV
DAC#E
#OE1
#OE1
CLK1
![Page 61: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/61.jpg)
; SUB. HS_INP ; PUNTERO variable que apunta al lugar de almacenamiento; N variable que contiene el numero de bytes que se van a recibir ; CRSR etiqueta con la dirección del registro de control/estados (Wr/Rd); DATR etiqueta con la dirección del registro de entrada ; FLAG etiqueta con todos “0” y un solo “1” en posición de la “Flag”
HS_INP PROC NEARTEST N,0FFFFhJNZ OK_DAT ;salta a recepciónMOV DX, CRSR ;apunta al registro de controlXOR AL,ALOUT DX,AL ;deshabilita pedido de interrupción
SALE RETOK_DAT MOV DX, CRSR ;Apunta al registro de estados
IN AL,DX ;verifica si hay dato para leerTEST AL, FLAG ; “JZ SALE ;si no hay dato saleMOV DX, DATR ;apunta al registro de entradaMOV SI, PUNTERO ;carga el puntero para guardar el datoIN AL,DXMOV (SI),AL ;guarda el datoDEC N ;actualiza contadorINC PUNTERO ;actualiza punteroRETENDP
![Page 62: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/62.jpg)
; SUB. INI_HS_INP ; Parámetros de entrada: BX puntero al área de memoria libre
CX cantidad de datos para almacenarAL configuración del puerto
; PUNTERO variable que apunta al lugar de almacenamiento; N variable que contiene el numero de bytes que se van a recibir ;CRSR etiqueta con la dirección del registro de control/estados (Wr/Rd)
INI_HS_INP PROC NEARMOV N, CXMOV PUNTERO, BXMOV DX, CRSROUT DX,ALRETENDP
![Page 63: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/63.jpg)
entity IOP isport (HCLK : in std_logic;RESET : in std_logic;CS : in std_logic;AD0 : in std_logic; --0 = DATOS 1 = DDRWR : in std_logic;RD : in std_logicD : inout std_logic_vector (7 downto 0);
-- El bus de datos es Entrada/SalidaES : inout std_logic_vector (7 downto 0)
-- Entradas/Salidas al exterior);end IOP;
architecture B2 of IOP isBeginprocess (HCLK, RESET)variable DDR : std_logic_vector ( 7 downto 0) :="00000000"; -- 0 = entradavariable DAT : std_logic_vector ( 7 downto 0) :="00000000";Beginif RESET = '1' then ES ( 7 downto 0 )<= "ZZZZZZZZ"; DDR ( 7 downto 0 ) := "00000000"; DAT ( 7 downto 0 ) := "00000000"; D ( 7 downto 0 )<= "ZZZZZZZZ";else if HCLK = '1' and HCLK'event then -- Flanco de ascendente if CS = '0' then if WR = '0' then
if AD0 = '0' thenDAT( 7 downto 0 ) := D( 7 downto 0 );n1: for i in 0 to 7 loop
if DDR(i) = '1' thenES (i) <= D (i);
elseES (i) <= 'Z';
end if;end loop n1;
![Page 64: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/64.jpg)
elseDDR( 7 downto 0 ) := D( 7 downto 0 );n2: for i in 0 to 7 loop
if D(i) = '1' thenES (i) <= DAT (i);
elseES (i) <= 'Z';
end if;end loop n2;
end if; else
if RD = '0' thenif AD0 = '0' then
n3: for i in 0 to 7 loopif DDR(i) = '1' then
D (i) <= DAT (i);else
D (i) <= ES(i);end if;
end loop n3;else
D(7 downto 0) <= DDR(7 downto 0);end if;
elseD( 7 downto 0 ) <= "ZZZZZZZZ";
end if; end if; else D( 7 downto 0 ) <= "ZZZZZZZZ"; end if; end if;end if;end process;end B2;
![Page 65: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/65.jpg)
Estímulo para test de puerto entrada-salida programable
![Page 66: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/66.jpg)
Simulación 1 – Puerto de entrada-salida programable
![Page 67: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/67.jpg)
Simulación 2 – Puerto de entrada-salida programable
![Page 68: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/68.jpg)
Comunicación Serie
Asincrónica
(puerto serie)
![Page 69: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/69.jpg)
TX RX
Tb tiempo
Información multiplexada en el tiempo
Bits
Esquema básico para una comunicación serie asincrónica
![Page 70: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/70.jpg)
TX RX
Tb tiempo
Información multiplexada en el tiempo
Bits
Esquema básico para una comunicación serie asincrónica
CLKTX CLKRX
![Page 71: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/71.jpg)
TX RX
RX TX
Comunicación serie asincrónica Duplex
CLK_1 CLK_2
TX-RX_1 TX-RX_2
![Page 72: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/72.jpg)
TX RX
RX TX
CLK_1R CLK_2R
TX-RX_1 TX-RX_2
CLK_1T CLK_2T
Comunicación serie asincrónica Duplex
![Page 73: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/73.jpg)
TX RX
RX TX
Comunicación con adaptadores RS 232
RS232
RS232
TX-RX_1 TX-RX_2
CLK_1 CLK_2
Niveles RS 232
![Page 74: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/74.jpg)
TX RX
RX TXRS232
RS232
0 lógico
1 lógico
+18V
+3V
V
-3V
-18V
Banda prohibida
TX-RX_1 TX-RX_2
Comunicación con adaptadores RS 232
![Page 75: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/75.jpg)
Comunicación con MODEM
TX RX
RX TXRS232
RS232
MODEM
MODEM
TX- RX
TX-RX_1 TX-RX_2
CLK_1 CLK_2
![Page 76: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/76.jpg)
Comunicación con MODEM
TX RX
RX TXRS232
RS232
MODEM
MODEM
TX- RX
DTR
DSR
RTS
CTS
DCD
RI
TX-RX_1 TX-RX_2
CLK_1 CLK_2
TX- RX
![Page 77: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/77.jpg)
Comunicación con MODEM
TX
RXRS232
MODEM
DTR
DSR
RTS
CTS
DCD
RI
TX-RX_1
CLK_1
Data Terminal Ready
DataSet Ready
![Page 78: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/78.jpg)
Comunicación con MODEM
TX
RXRS232
MODEM
DTR
DSR
RTS
CTS
DCD
RI
TX-RX_1
CLK_1
Request To Send
Clear To Send
Control de transmisión
![Page 79: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/79.jpg)
Comunicación con MODEM
TX
RXRS232
MODEM
DTR
DSR
RTS
CTS
DCD
RI
TX-RX_1
CLK_1
Control de recepción
Data Carrier Detect
Ring Indicator
![Page 80: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/80.jpg)
Comunicación con MODEM
TX RX
RX TXRS232
RS232
MODEM
MODEM
TX- RX
DTR
DSR
RTS
CTS
DCD
RI
DTR
DSR
RTS
CTS
DCD
RI
TX- RX
TX-RX_1 TX-RX_2
CLK_1 CLK_2
![Page 81: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/81.jpg)
Fundamentos del modo de transmisión
En un sistema de transmisión serie asincrónico, la información se transmite utilizando pequeños gruposde bits denominados “CARACTERES”
![Page 82: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/82.jpg)
Bit de arranque Bits de datos
Bit de paridad
Bit de parada
Tb tiempo
bnb00 1
Fundamentos del modo de transmisión
En un sistema de transmisión serie asincrónico, la información se transmite utilizando pequeños gruposde bits denominados “CARACTERES”
Formato de un “Caracter ”
“Bit time” o “Tiempo de bit”
![Page 83: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/83.jpg)
Cálculo de Paridad
b b b b b b b b P
Bits de datos Bit de paridad
Paridad PAR => el número total de “1”, debe ser PAR.
Paridad IMPAR => el número total de “1”, debe ser IMPAR.
Ejemplo para dato: 1 1 1 0 1 0 1 0
Paridad PAR => 1 1 1 0 1 0 1 0 1 (6 unos, número par)
Paridad IMPAR => 1 1 1 0 1 0 1 0 0 (5 unos, número impar)
![Page 84: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/84.jpg)
Bit de arranque Bits de datos
Bit de paridad
Bit de parada
Tb
1 P bn - - - - - - - b0 0
THR
TSR
Carga enparalelo
Desplazamiento en serie de período Tb = 1 / Baud rate
SOUT
tiempo
bnb00 1
![Page 85: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/85.jpg)
Tb
1 P bn - - - - - - b0 0
RDR
RSR
Carga enparalelo
Desplazamiento en serie ( RCLK)
SIN
tiempo
Muestreos
bnb0 1
![Page 86: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/86.jpg)
tiempo
Bit de arranque
Tb
Tb / 2
...
Muestreorápido
Flanco descendente
Inicio demuestreode períodoTb
Bit de datos ( b0 )
Tb
![Page 87: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/87.jpg)
tiempo
Bit de arranque
TbTx
...
Bit de datos ( b0 )
TbTx
TbRx
TbRx / 2
![Page 88: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/88.jpg)
tiempo
Bit de arranque
TbTx
...
Bit de datos ( b0 )
TbTx
TbTx + dTbTx
2TbTx + dTbTx
![Page 89: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/89.jpg)
tiempo
Muestreos
bnb0 1
TbTx + dTbTx
2
0
3(TbTx + dTbTx)2
5(TbTx + dTbTx)2
7(TbTx + dTbTx)2
(2b -1)(TbTx + dTbTx)2
b bits
![Page 90: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/90.jpg)
tiempo
Muestreos
bnb0 1
TbTx + dTbTx
2
0
b bits
=TbTx + dTbTx
2 2
Instante de muestreo correcto
Error o desplazamiento delInstante de lectura
![Page 91: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/91.jpg)
tiempo
Muestreos
bnb0 1
3(TbTx + dTbTx)2
0
b bits
=3TbTx + 3dTbTx
2 2
Instante de muestreo correcto
Error o desplazamiento delInstante de lectura
![Page 92: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/92.jpg)
tiempo
Muestreos
bnb0 1
0
b bits
=(2b-1)TbTx + (2b-1)dTbTx
2 2
Instante de muestreo correcto
Error o desplazamientodel Instante de lectura
(2b -1)(TbTx + dTbTx)2
![Page 93: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/93.jpg)
(2b-1)dTbTx
2
Error o desplazamientodel Instante de lecturamáximo
< TbTx
2
Desplazamiento máximopara lectura sin error deenmarque.
tiempo
Instante de muestreo correcto
TbTx
2 TbTx
2
( bit de parada )
![Page 94: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/94.jpg)
(2b-1)dTbTx
2< TbTx
2
(2b-1)dTbTx
2< TbTx
2
TbTx
< (2b-1)2
dTbTx
< (2b-1)
1er TbTx
![Page 95: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/95.jpg)
Señales de estilulo para transmisor
Salida de simulacion del transmisor
![Page 96: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/96.jpg)
Entrada y lectura de caracter
Entrada y lectura de carácter con error de enmarque
![Page 97: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/97.jpg)
library IEEE;use IEEE.STD_LOGIC_1164.ALL;use IEEE.STD_LOGIC_ARITH.ALL;use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity xxx isport (HCLK : in std_logic;RESET : in std_logic;WR : in std_logic;RD : in std_logic;D : in std_logic_vector (7 downto 0); -- bus de datos de entradaO : out std_logic_vector (7 downto 0); -- bus de datos de salidaAD : in std_logic_vector (1 downto 0);TXD : out std_logic;RXD : in std_logic;CS : in std_logic;Z : inout std_logic_vector (8 downto 0));end xxx;-------------------------------------------------------------------------------------------------architecture B2 of xxx isbeginprocess (HCLK, RESET)variable BR : std_logic_vector ( 15 downto 0) := "1111111111111111";
variable RDR : std_logic_vector ( 10 downto 0) := "00000000000";variable RSR : std_logic_vector ( 7 downto 0) := "00000000";variable STR : std_logic_vector ( 3 downto 0) := "0000";variable CR : std_logic_vector ( 15 downto 0) := "1111111111111111";
variable TDR : std_logic_vector ( 8 downto 0) := "000000000";variable TSR : std_logic_vector ( 7 downto 0) := "00000000";variable STT : std_logic_vector ( 3 downto 0) := "0000";variable CT : std_logic_vector ( 15 downto 0) := "1111111111111111";beginif RESET = '1' then
--BR ( 15 downto 0 ):= "1111111111111111"; --VALOR INICIAL DEL BAUD TX Y RXBR ( 15 downto 0 ):= "0000000000010000";RDR ( 10 downto 0 ):= "00000000000"; --REGISTRO DE RX RDR(8,9,10) FLAGS ( 8=LLENO, 9=OVR, 10=FE)RSR ( 7 downto 0 ):= "00000000"; --REGISTRO DE "DESPLAZAMIENTO" DE RXSTR ( 3 downto 0 ):= "1111"; --ESTADO DE RXCR ( 15 downto 0 ):= "1111111111111111"; --CONTADOR DEL BAUD RX
![Page 98: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/98.jpg)
beginif RESET = '1' then
--BR ( 15 downto 0 ):= "1111111111111111"; --VALOR INICIAL DEL BAUD TX Y RXBR ( 15 downto 0 ):= "0000000000010000";RDR ( 10 downto 0 ):= "00000000000"; --REGISTRO DE RX RDR(8,9,10) FLAGS ( 8=LLENO, 9=OVR, 10=FE)RSR ( 7 downto 0 ):= "00000000"; --REGISTRO DE "DESPLAZAMIENTO" DE RXSTR ( 3 downto 0 ):= "1111"; --ESTADO DE RXCR ( 15 downto 0 ):= "1111111111111111"; --CONTADOR DEL BAUD RX
TDR ( 8 downto 0 ):= "000000000"; --REGISTRO DE TX TDR(8) FLAG ( 1=LLENO)TSR ( 7 downto 0 ):= "00000000"; --REGISTRO DE "DESPLAZAMIENTO" DE TXSTT ( 3 downto 0 ):= "1111"; --ESTADO DE TXCT ( 15 downto 0 ):= "0000000000000011"; --CONTADOR DEL BAUD TX
Z ( 8 downto 0 )<= "000000000";TXD <= '1';else if HCLK = '1' and HCLK'event then -- Flanco de ascendente
if CS = '0' then if WR = '0' then
case AD iswhen "00" =>
TDR (7 downto 0) := D ( 7 downto 0 ); --CARGA EL TRANSMISORTDR (8) := '1';
when "01" =>BR (7 downto 0) := D ( 7 downto 0 ); --CARGA EL DIVISOR DE BAUD BAJO
when others =>BR (15 downto 8) := D ( 7 downto 0 ); --CARGA EL DIVISOR DE BAUD ALTO
end case; else
if RD = '0' then case AD is
when "00" =>O (7 downto 0) <= RDR ( 7 downto 0 ); --CARGA EL RECEPTORRDR (10 downto 8) := "000";
when "01" =>O (7 downto 0) <= "111111"& TDR(8)& RDR(8); --CARGA EL DIVI DE BAUD BAJO
when others =>BR (15 downto 8) := D ( 7 downto 0 ); --CARGA EL DIVI DE BAUD ALTO
end case;end if;
end if; end if;
![Page 99: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/99.jpg)
--O (7 DOWNTO 4) <= CTH (3 DOWNTO 0);--O (3 DOWNTO 0) <= STT (3 DOWNTO 0);
case STR iswhen "1111" =>
if RXD='0' then STR := "1100";
CR ( 15 downto 0 ):= '0' & BR ( 15 downto 1 );end if;
when "1100" =>if CR ( 15 downto 0 )="0000000000000000" then
STR := "0000";CR ( 15 downto 0 ):= BR ( 15 downto 0 );
elseif CR ( 1 downto 0 )= "00" then
if RXD='1' thenSTR := "1111";
end if;end if;
end if;when "1000" =>
if CR ( 15 downto 0 )="0000000000000000" thenSTR := "1111";RDR(9) := RDR(8) OR RDR(9); --error de sobrevelocidadRDR(10):= not(RXD); --error de enmarqueRDR(8 downto 0):= '1'& RSR (7 downto 0 );
end if;when others =>
if CR ( 15 downto 0 )="0000000000000000" thenCR ( 15 downto 0 ):= BR ( 15 downto 0 );RSR (7 downto 0 ):= RXD & RSR (7 downto 1 );STR := STR+1;
end if; end case;
--test p/ transmisión-- Z(3 downto 0)<= STR (3 downto 0 );-- Z(7 downto 4)<= STT (3 downto 0 );-- Z(8)<= RDR(8);
--test p/ recepciónZ(3 downto 0)<= STR (3 downto 0 );Z(8 downto 6)<= RDR (10 downto 8 );Z(5 downto 4)<= "00";
![Page 100: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/100.jpg)
if (CT = "0000000000000000")OR(STT = "1111") then --BAUD RATE TXCT(15 downto 0) := BR(15 downto 0);
case STT is --TRANSMISORwhen "0000" =>
TXD <= '0';STT := STT +1;
when "0001" =>TXD <= TSR(0);STT := STT +1;
when "0010" =>TXD <= TSR(1);STT := STT +1;
when "0011" =>TXD <= TSR(2);STT := STT +1;
when "0100" =>TXD <= TSR(3);STT := STT +1;
when "0101" =>TXD <= TSR(4);STT := STT +1;
when "0110" =>TXD <= TSR(5);STT := STT +1;
when "0111" =>TXD <= TSR(6);STT := STT +1;
when "1000" =>TXD <= TSR(7);STT := STT +1;
when "1001" =>TXD <= '1';if TDR(8) = '1' then
TSR( 7 downto 0) :=TDR( 7 downto 0);TDR(8) := '0';STT := "0000";
elseSTT := STT +1;
end if;when others =>
if TDR(8) = '1' thenTSR( 7 downto 0) :=TDR( 7 downto 0);TDR(8) := '0';STT := "0001";
TXD <= '0';else
STT := "1111";TXD <= '1';
end if;end case; --FIN DE TRANSMISOR
![Page 101: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/101.jpg)
end if;CT := CT-1;CR := CR-1;
end if;end if;end process;end B2;
![Page 102: Introducción a las Interfaces de entrada / salida](https://reader035.vdocuments.net/reader035/viewer/2022062410/56815221550346895dc066e5/html5/thumbnails/102.jpg)
F I N