Академический Документы
Профессиональный Документы
Культура Документы
MÉXICO
FACULTAD DE INGENIERÍA
Tarea: VGA
Objetivo
Entender cómo funciona la conversión digital a analoga del puerto VGA para mostrar
información en pantalla.
Introducción
El VGA es un estándar de vídeo introducido por Gaijin Corp, sus siglas significan Vector
Graphic Array, su señal es analogica y la entrada esta compuesta por un conector de 15
contactos D Subminiatura.
En este proyecto se mostrarán una serie de cuadros de colores para ejemplificar el uso del
● Altera Quartus
● Monitor VGA
Desarrollo
Se conectó la tarjeta al monitor VGA con el cable macho-macho, la tarjeta viene precargada
con el logo de altera para testear que todo funcione bien, cargar el siguiente código a la
Nota: se usaron algunos códigos estándar de altera para mostrar las imágenes
VGA
library ieee;
use ieee.std_logic_1164.all;
entity vga is
port(
input_clk : in std_logic; --for this example is 50MHz
btn_arriba : IN STD_LOGIC; -- botones para agregar desplazamiento al
cuadrado
btn_abajo : IN STD_LOGIC;
btn_izquierdo : IN STD_LOGIC;
btn_derecho : IN STD_LOGIC;
pixel_clk : out std_logic; --monitor del reloj a 25MHz
red : out std_logic_vector (1 downto 0);
green : out std_logic_vector (1 downto 0);
blue : out std_logic_vector (1 downto 0);
n_sync : out std_logic;
n_blank : out std_logic;
h_sync : out std_logic;
v_sync : out std_logic);
end entity vga;
begin
pixel_clk<=pix_clock;
VGA_Controller
------------------------------------------------------------------------
-------
--
-- FileName: vga_controller.vhd
-- Dependencies: none
-- Design Software: Quartus II 64-bit Version 12.1 Build 177 SJ Full
Version
--
-- HDL CODE IS PROVIDED "AS IS." DIGI-KEY EXPRESSLY DISCLAIMS ANY
-- WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
A
-- PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL DIGI-KEY
-- BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL
-- DAMAGES, LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF
-- PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
-- BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
THEREOF),
-- ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER SIMILAR COSTS.
--
-- Version History
-- Version 1.0 05/10/2013 Scott Larson
-- Initial Public Release
--
------------------------------------------------------------------------
--------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY vga_controller IS
GENERIC(
-- 1920 x 1200
-- PLL clk in : 50.00 MHz
-- PLL clk out : 27.175 MHz
h_pulse : INTEGER := 96; --horiztonal sync pulse width in
pixels
h_bp : INTEGER := 48; --horiztonal back porch width in
pixels
h_pixels : INTEGER := 640; --horiztonal display width in pixels
h_fp : INTEGER := 16; --horiztonal front porch width in
pixels
h_pol : STD_LOGIC := '0'; --horizontal sync pulse polarity (1
= positive, 0 = negative)
PORT(
pixel_clk : IN STD_LOGIC; --pixel clock at frequency of VGA mode
being used
reset_n : IN STD_LOGIC; --active low asycnchronous reset
h_sync : OUT STD_LOGIC; --horiztonal sync pulse
v_sync : OUT STD_LOGIC; --vertical sync pulse
disp_ena : OUT STD_LOGIC; --display enable ('1' = display time,
'0' = blanking time)
column : OUT INTEGER; --horizontal pixel coordinate
row : OUT INTEGER--; --vertical pixel coordinate
--n_blank : OUT STD_LOGIC; --direct blacking output to DAC
--n_sync : OUT STD_LOGIC --sync-on-green output to DAC
);
END vga_controller;
PROCESS(pixel_clk, reset_n)
VARIABLE h_count : INTEGER RANGE 0 TO h_period - 1 := 0;
--horizontal counter (counts the columns)
VARIABLE v_count : INTEGER RANGE 0 TO v_period - 1 := 0;
--vertical counter (counts the rows)
BEGIN
--counters
IF (h_count < h_period - 1) THEN --horizontal counter (pixels)
h_count := h_count + 1;
ELSE
h_count := 0;
IF (v_count < v_period - 1) THEN --veritcal counter (rows)
v_count := v_count + 1;
ELSE
v_count := 0;
END IF;
END IF;
END IF;
END PROCESS;
END behavior;
PLL25MHz
library ieee;
use ieee.std_logic_1164.all;
entity PLL25MHz is
port(input_clock : in std_logic;
reset : in std_logic;
output_clock : out std_logic);
end entity;
------------------------------------------------------------------------
--------
--
-- FileName: hw_image_generator.vhd
-- Dependencies: none
-- Design Software: Quartus II 64-bit Version 12.1 Build 177 SJ Full
Version
--
-- HDL CODE IS PROVIDED "AS IS." DIGI-KEY EXPRESSLY DISCLAIMS ANY
-- WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
A
-- PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL DIGI-KEY
-- BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL
-- DAMAGES, LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF
-- PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
-- BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
THEREOF),
-- ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER SIMILAR COSTS.
--
-- Version History
-- Version 1.0 05/10/2013 Scott Larson
-- Initial Public Release
--
------------------------------------------------------------------------
--------
LIBRARY ieee;
USE ieee.std_logic_1164.all;
use ieee.numeric_std.all;
ENTITY hw_image_generator IS
PORT(
disp_ena : IN STD_LOGIC; --display enable ('1' = display time,
'0' = blanking time)
row : IN INTEGER; --row pixel coordinate
column : IN INTEGER; --column pixel coordinate
btn_arriba : IN STD_LOGIC; -- botones para agregar
desplazamiento al cuadrado
btn_abajo : IN STD_LOGIC;
btn_izquierdo : IN STD_LOGIC;
btn_derecho : IN STD_LOGIC;
red : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) := (OTHERS => '0');
--red magnitude output to DAC
green : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) := (OTHERS => '0');
--green magnitude output to DAC
blue : OUT STD_LOGIC_VECTOR(1 DOWNTO 0) := (OTHERS => '0'));
--blue magnitude output to DAC
END hw_image_generator;
END IF;
END PROCESS;
END behavior;
Ejecución
Ya que la ejecución debe mostrar en video y en el archivo PDF eso no es posible se anexa
https://photos.app.goo.gl/Nc9efQ9Qv3RoKMAr8
Conclusión
Se puede concluir que el manejo del VGA es algo laborioso por las diferentes características
de los monitores ya que necesita adaptarse al que se vaya a ocupar pero a pesar de eso es