0% found this document useful (0 votes)
57 views

VGA Configuration Algorithm Using VHDL

This document describes a VGA configuration algorithm using VHDL. It discusses how a VGA controller can work with different resolutions to display information. The authors Christian Plaza, Olga Ramos, and Dario Amaya from the Universidad Militar Nueva Granada propose generating synchronization signals on an FPGA programmed with VHDL to correctly display images on a VGA monitor. Key factors that affect synchronization frequency are discussed, such as resolution and refresh rate. The VGA controller allows high-speed processing and is suitable for applications like color recognition.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

VGA Configuration Algorithm Using VHDL

This document describes a VGA configuration algorithm using VHDL. It discusses how a VGA controller can work with different resolutions to display information. The authors Christian Plaza, Olga Ramos, and Dario Amaya from the Universidad Militar Nueva Granada propose generating synchronization signals on an FPGA programmed with VHDL to correctly display images on a VGA monitor. Key factors that affect synchronization frequency are discussed, such as resolution and refresh rate. The VGA controller allows high-speed processing and is suitable for applications like color recognition.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

VGA configuration algorithm using VHDL

1
Christian Plaza, 2Olga Ramos, 3Dario Amaya
{1u1802242, 2olga.ramos, 3dario.amaya}@unimilitar.edu.co
Virtual Applications Group-GAV, Nueva Granada Military University –UMNG

Abstrab- Nowadays it is important to visualize information, with the purpose of generate real-time data about
a device or a process to a user, this would help to identify problems and generate solutions in a simpler way.

A VGA controller can work with different types of resolution; this can be used to create an incredible amount
of characters, which can be useful to visualize a lot of information in an easier way, a VGA controller
generates synchronization signals produce on a FPGA (programed on VHDL language), this allows the
correct visualization on a VGA monitor.

Some of the most significant factors that can affect the frequency of synchronisms are resolution and the
refresh frequency, A VGA controller can be used in many applications due to the high processing speed of the
FPGA, it is perfect for color recognition.

Index Terms: image processing, image visualization, synchronism, VGA port.


I. Introduction controller, in some cases they are going to be
positive and other negatives.
Nowadays there are different kinds of electronics
devices that allows the visualization and interaction The first thing that is required for the image
of information with the user, in a direct way visualization is the vertical and horizontal sync,
through an electronic device, this can make real this are composed by four types of elements: the
time modifications depending on the current input first one is the Back Porch, this one indicates the
values that receive the device. One of the most used beginning of the sync, next it precedes by the Sync
Pulse this generate an inversion of polarity in the
system is a monitor with a VGA input.
synchronism, after this continues the Front Porch
The VGA Port (Video Graphics Array), is a graphic returning to the initial value of the polarity and
card that allows to visualizer image on a monitor, finally the number of pixel in the display. [3]
through an electronic device that generate sync When the Front Porch, the Sync Pulse and the back
signals, this signals can be change to be compatible porch are running it is known as the Blanking Time
with different monitors and resolutions. [1] and the most significant characteristic is that in all
that time the monitor it is not going to generate any
In a VGA controller it is really important to
kind of image, when the count arrive the number of
consider two differences kinds of signals, the
pixels of the display, the visualization of images
horizontal and vertical synchronization signals.
with the respective RGB values takes place on the
This allows to visualize an image through the
monitor. [4]
monitor, the values of frequency depend on the
kind of resolution that is required and the update When the image visualization is taking place the
frequency, the last one indicates the number of FPGA send data in a digital way there correspond
times that a monitor is going to repaint in one to the value of the color, also in the monitor, there
second, the standard value is 60 Hz. [2] are three different types of analog signals that
create the color, with a maximum value of 256
There are different types of resolution, also there
colors. The color intensity depend of the voltage
are different update frequency (this one had
value from the analog signal, most of the FPGA had
normalize values). For each one of these there are
a digital analog converser to realize this kind of
different values for the pixel clock, front porch,
conversion. [5]
back porch and sync pulse. Besides the sync
polarity changes depending on the current VGA
II. Methods and materials
For the project which main object is the color
identification on a VGA monitor. Software and
Hardware were selected to have a decent efficiency
during the project development.

Image visualization on a VGA

In the Figure 1 it can be seen the FPGA and the


VGA monitor connections.

Fig. 2 FPGA block program.

Flowchart

In the figure 3 the flowchart of the developed


program will be presented.

Fig. 1 Connection diagram FPGA VGA.

There are two important design stages on these


project, which will be described below. The first
one consist on the creation of a clock that allow the
count of the pixels, a controller will be
implemented (this contains the horizontal and
vertical sync signals) for the required resolution,
and the other one visualize an image on a
determined pixel. [6]

FPGA: (Field Programmable Gate Array) is a


reprogrammable electronic device that allow the
parallel programing, the response time it is really Fig. 3 Flowchart
fast, it is an economic alternative compared to other
elements because it is reprogrammable. [7] Implemented code
VGA Monitor: is a device that enable the image For the creation of the VGA controller the code on
visualization through a VGA port, these has the Figure 4 was implemented.
different resolution, and works by shifting an
electron beam through the screen for viewing
images. [8]

FPGA block diagram

The figure 2 show a block representation of the Fig. 4 VGA controller, initialization of variables
FPGA programming.
.
The first thing to determinate are the maximum
values for the vertical and horizontal sync signals,
those values can change depending on the
resolution and the update frequency, for these
project it will be use a 640x480 resolution working
with 60 Hz obtaining the following values
described in the [9]

Table 1. Different values for a 640x480 resolution


using 60 Hz.

Characteristics Horizontal Vertical


Display 640 480
Front Porch 16 10
Sync Pulse 96 2
Back Porch 48 33 Fig. 6 VGA controller, synchronism pulse activation
Polarity Negative Negative
With the pixel counter it can be determinate in
synchronism
which time the horizontal and vertical sync pulse
Total 800 525
should be activated (using the parameters from the
The sum of the Display, Front Porch, Sync Pulse, table 1) the horizontal sync signal will be activated
Back Porch, it will give as a result the total period on this pixel range [656 – 752], for the vertical sync
of the duration for the sync pulse, using the polarity signal the following range [490 – 492], for both
of the synchronism will perform a state change in cases the signal was on a logic state ‘1’, will be
the signal so that the controller works correctly change for a ‘0’ while the pixel counter remain on
figure 5. the previous ranges Figure 7. [10]

Fig. 7 VGA controller, rows and columns assignment

A new variable is created for maintain the current


position of the pixel with respect to the resolution
Fig. 5 VGA controller, vertical and horizontal counter. implemented on the controller Figure 8.
Obtained the total period value of the vertical and
horizontal sync signals, a sum conditional was
implemented, while the counter is less from the
total period value of the signal a unit value will be
added to it, but when the value is more than the total
value the counter will be reset Figure 6. Fig. 8 VGA controller, enable activation.

Finally a digital flag was implement to restrict the


image visualization on the VGA port while the
pixel counter was on the range [0 – 640] (horizontal
counter), and [0 – 480] (vertical counter).
III. Analysis of results
In the current part, the different results obtained on
the image processing will be explain.

The result show on the Figure 9, is the


implementation and visualization of a square on the
VGA monitor, the beginning of coordinates is
located on the top left corner of the monitor, a
square will be draw while the pixel counter is in a
certain coordinates (the pixel will have a violet
color), if the counter is outside the range the pixel
will be set up as green. [11] Fig. 11 Test 2, result.

If the pixel clock is outside the range the RGB


output will be set up as 0, as it can be seen on the
figure 12.

Fig. 9 Final result

Knowing the current position of the pixel can


provide different conditions, this can be used to
generate different amounts of geometrics figures,
in this particular case a square, the OTHERS
indicates that the others bits will have the same
value as the one indicated on the function.
Fig. 12 Code test 2

On the third test a sine signal simulation was


proposed, for this a design of circle compose of 37
pixels was created, the current pattern is going to
localize on different coordinates, also an axis allow
the guidance of these points on the VGA monitor.
Figure 13. [13]

Fig. 10 Code Test 1

The second test is similar to the before, the changes


made were the coordinate of the square and the
color that are going to be used, in this particular
case the color yellow (mix between red and blue)
and cyan were used Figure 11. [12]
Fig. 13 Display of points.
The design pattern that was used for the group of
37 pixels is shown in the Figure 14.

Fig. 16 sinusoidal signal

For the code on the 17 figure, two different


variables will be created (X, Y), those variables
allow to change the center of the circles, the last
Fig. 14 37 pixel pattern one were create using square and rectangles (Figure
19), changing the X and Y values can change the
This pattern allows in some way visualize the pixel position of the circles without having to modify or
on a circular form, this is produce because of the create a new code, the verticals and horizontal lines
size of the resolution is wide (640x480 pixel), if the on the Figure 21 will be created using an if
resolution were lower the square patterns conditional on the desired position.
characteristic of the pixels would be displayed, by
reproducing this same figure in different
coordinates it can get the shape of a sinusoidal
signal, as show on the 15 and 16 figures.

Fig. 15 Image processing result

An axis can be a guide for the sinusoidal signal,


these can simulate the different intervals of the
signal values, and the beginning.

Fig. 17 Circle code generator


IV. Conclusions
The image visualization on a VGA monitor allow
to have an bigger control with respect to other
visualization methods, with these type of
controllers a greater precision and a pixel to pixel
color control can be achieve , currently is use
because of the increase in the use of technology and
its ability to visualize transcendent information.

It is really important consider the sync times and


the signal polarity, an incorrect polarity on the
system will not allow the driver work properly,
other aspect to have in count is the phase shift of
the synchronism signal these will result in a
problem in the visualization of pixels and it is
common problem on a driver develop on a micro
controller.
V. References

[1] P. Wilson, «Design Recipes for FPGAs: Using Verilog and VHDL,» de Design Recipes for FPGAs: Using Verilog
and VHDL, Oxford, Elsevier Science, 2011-02-24, pp. 161-168.

[2] Y. Li, «Computer Principles and Design in Verilog HDL,» de Computer Principles and Design in Verilog HDL,
Japan, John Wiley & Sons, Incorporated, 2015-06-30, pp. 466-467.

[3] P. P. Chu, «Embedded SoPC Design with Nios II Processor and Verilog Examples,» de Embedded SoPC Design
with Nios II Processor and Verilog Examples, New Jersey, John Wiley & Sons, Incorporated, 2012-05-14, p.
475.

[4] A. R. M. K. J. V. Staudt, «IEEE XPLORE,» 15-18 06 2015. [En línea]. Available:


http://ieeexplore.ieee.org.ezproxy.umng.edu.co:2048/stamp/stamp.jsp?arnumber=7174718. [Último
acceso: 07 02 2017].

[5] L.-p. N. P. S. Chen-lu Feng, «IEEE Xplore,» 21 01 2016. [En línea]. Available:
http://ieeexplore.ieee.org.ezproxy.umng.edu.co:2048/stamp/stamp.jsp?arnumber=7387566. [Último
acceso: 07 02 2017].

[6] P. Krzysztof (Kris) Iniewski, CMOS Nanoelectronics: Analog and RF VLSI Circuits, New York: McGraw-Hil, 2011.

[7] Y. Xu, «EBSCOhost,» 01 05 2017. [En línea]. Available:


http://web.b.ebscohost.com.ezproxy.umng.edu.co:2048/ehost/pdfviewer/pdfviewer?vid=1&sid=5edbd901-
a62e-4cbb-bf24-96d14181fd37%40sessionmgr101. [Último acceso: 07 02 2017].

[8] D. G. Bailey, Design for Embedded Image Processing on FPGAs, New Zealand: Wiley, 2011-05-25.

[9] S. Larson, «eewiki,» eewiki, 26 05 2017. [En línea]. Available:


https://eewiki.net/pages/viewpage.action?pageId=15925278. [Último acceso: 07 02 2017].

[10] T. K. Eismin, Aircraft Electricity and Electronics, New York: McGraw-Hill Education, 2014.

[11] D. G. F. H. Wayne Beaty, Standard Handbook for Electrical Engineers, New York: McGraw-Hill Companies,
2013.

[12] M. Bass, Handbook of Optics: Volume I - Geometrical and Physical Optics, Polarized Light, Components and
Instruments, New York: McGraw-Hill Professional, 2010.

[13] M. G. J. H. Xujun Ye, «IEEE Xplore,» IEEE Xplore, 08 02 2016. [En línea]. Available:
http://ieeexplore.ieee.org.ezproxy.umng.edu.co:2048/stamp/stamp.jsp?arnumber=7399957. [Último
acceso: 07 02 2017].

You might also like