January/February 2016 - page 26

November 2015
26
G
raphics
C
ontrol
Controlling graphics without
a controller
By Adam Folts,
Microchip
This article shows how
a low-cost controllerless graphics
system can be implemented
with microcontroller peripherals
to create a virtual graphics controller
using only a small amount
of CPU time.
„„
One of the popular ways of creating graphi-
cal embedded applications is to add an internal
or external graphics controller. The problem
is that this adds cost and can make designs
unnecessarily complex, and in most cases for a
simple graphical user interface such controllers
are not needed. An alternative is to use micro-
controller peripherals to create a virtual graph-
ics controller for graphics rendering without
taking up large amounts of CPU time, in fact it
can be less than five per cent.
In general, a controllerless graphics system
needs to send a frame of pixel information to
a display glass at a certain rate. This refresh
rate is usually around 60Hz. To do this, the
system must constantly send frame data to
the LCD panel. At first, it seems like this task
would take up most of the CPU time in an
MCU. However, this is not the case for micro-
controllers, such as Microchip PIC32 MCUs,
that contain a direct memory access (DMA)
peripheral for data transfer. With a DMA
transferring the pixel data, less than five per
cent of CPU time can be used to achieve a vir-
tual graphics controller.
The DMA peripheral can transfer data from
one location to another without CPU inter-
vention. In a controllerless graphics method,
the DMA can be set up to transfer one line of
frame data at a time through the parallel mas-
ter port (PMP). Each line consists of many
pixels. The DMA would send a portion of the
frame buffer during one transfer. A PMP or
timer interrupt request would then trigger the
next DMA transfer until a line is transferred.
In devices with non-persistent interrupts, a
timer can be used as the DMA trigger source.
For devices with an external bus interface
(EBI), this module can be used as a pixel clock
source. Such a clock source can achieve faster
pixel clock speeds than the PMP peripheral,
yet the EBI shares the same pins as the PMP.
During data transfers, the PMP or EBI strobes
a read or write signal after each pixel transfer.
The read-write strobes act as the pixel clock
for the display glass. After each line of pixel
data is transferred, the CPU is interrupted by
the DMA and certain timing signals – such as
HSYNC, VSYNC and data enable line (DEN)
– needed for LCD panels are updated. This is
repeated continuously until an entire frame
has been drawn. The frame is stored in volatile
memory so the image can be dynamic. In this
setup, SRAM is used and the configuration is
the foundation for a controllerless graphics
system. The system can be set up to use inter-
nal or external SRAM, as shown in figures 1
and 2. Though the controllerless graphics
method was designed to work with TFT LCD
panels, it can also work with CSTN or MSTN
glass with minor modifications. The data
lines consist of the pixel colour information.
Most LCD panels can have eight to 24 colour
data lines depending on the colour depth of
the LCD panel. These data lines supply the
LCD panel with the raw colour data of each
pixel. The HSYNC, VSYNC, DEN and PCLK
clock signals synchronise the pixel data with
the graphics frame and the LCD panel. The
sync lines tell the LCD panel when the data
are at the start or end of a line (HSYNC) or a
frame (VSYNC). The DEN lets the LCD panel
know when valid pixel data are being sent to
the LCD panel and is required for some TFT
LCD panels because of the time needed to set
up the LCD panel for proper pixel locations.
Data are sent one line at a time until the entire
frame is drawn. The PCLK signal is the clock
source for the whole system. One clock pulse
from the PCLK updates the LCD panel. All
other clock lines must be synchronised to
the pixel clock to achieve proper image out-
put. LCD panels not containing HSYNC and
VSYNC signals can still be used with the con-
trollerless graphics setup.
Microchip’s low-cost controllerless graphics
PICtail Plus daughter board (LCC graphics
board) was designed to demonstrate this tech-
nique and works with many existing PIC32
starter kits. The LCC software driver can help
with synchronisation needing certain timing
parameters, such as pulse width, front porch
1...,16,17,18,19,20,21,22,23,24,25 27,28,29,30,31,32,33,34,35,36,...44
Powered by FlippingBook