January/February 2016 - page 27

November 2015
27
G
raphics
C
ontrol
and back porch for horizontal and vertical
pulses. After these values are compiled into
the LCC graphics driver, the LCD panel dis-
plays the frame. Figure 3 shows what hap-
pens inside the PIC32 microcontroller when
a graphics frame is being sent to the display.
The DMA and PMP block indicates what the
DMA and PMP peripherals that share the
data bus with the CPU are performing. The
CPU block indicates the tasks required for
graphics rendering. The DMA interrupt ser-
vice routine (ISR) is the only code that must
be written besides setting up the DMA and
PMP peripherals to send a graphics frame to
the display.
Rendering new pixels in the frame buffer is
as important as refreshing the screen. This is
performed by the CPU writing to the display
buffer. If the frame is stored externally, the
DMA transfer is suspended while the frame
is being updated. This is necessary because
there is only one PMP peripheral and it is
being shared by the virtual graphics control-
ler or DMA transfer. This method does affect
the refresh rate of the screen. The amount of
pixel updates needs to be monitored to pre-
vent too large a refresh rate change, otherwise
the change will be perceptible by the human
eye. This is done by using a pixel count vari-
able within the virtual graphics controller that
is updated on every pixel write and cleared
during every DMA interrupt.
With the introduction of the EBI periph-
eral, the suspension time needed for a frame
update is dramatically reduced. When the EBI
is used for writing, less data need to be stored
and restored since the PMP registers are no
longer being shared for reading and writ-
ing. Also, the EBI module is a more efficient
peripheral when communicating to external
SRAM.
The internal SRAM method uses the write
strobe of the PMP for the pixel clock. Jumper
rows one and two on the LCC graphics board
must be set for this configuration. In this setup,
all colour is 8BPP and no external SRAM is
used. SRAM from inside the MCU is con-
tinuously writing its pixel values to the PMP.
For 8BPP colour, a 332 RGB colour format is
used, that is three colour values for red, three
for green and two for blue. This is a common
colour format, because red is an easier colour
for the human eye to detect than blue.
The external SRAM method uses the read
strobe of the PMP for the pixel clock. Jumper
rows two and three on the LCC graphics
board must be set for this configuration. In
this setup, all colour is 16BPP and the exter-
nal SRAM contains the graphics frame that is
continuously being read. For 16BPP colour, a
565 RGB format is used with five colour val-
ues for red, six for green and five for blue.
In both methods, when connecting to an LCD
panel with more than 16 colour lines, the
unused colour lines are tied to the most sig-
nificant bits of the last colour bit being used.
This ensures that a full colour scale fromwhite
to black can be achieved.
n
Figure 1. External memory method
Figure 2. Internal memory method
Figure 3. PIC32 microcontroller LCC graphics flowchart
Embedded News & Know-how Newsletter
1...,17,18,19,20,21,22,23,24,25,26 28,29,30,31,32,33,34,35,36,37,...44
Powered by FlippingBook