
4
Configuring the élanSC300 Device’s Internal CGA Controller for a Specific LCD Panel
Although the HGA standard supports two 32-Kbyte dis-
play pages, only 32 Kbyte of video SRAM are available
on the élanSC300 microcontroller. Therefore, the
élanSC300 microcontroller will only allow access to
B0000–B7FFF in HGA mode.
In HGA Text mode, the élanSC300 microcontroller gets
its fonts from SRAM rather than ROM. The character
width is fixed at nine pixels (the 9th column being auto-
matically generated), but the character height is pro-
grammable. Chapter 3 of the élan
T M
SC300
Microcontroller Programmer’s Reference Manual
de-
tails the way the font areas are addressed.
MEMORY MAP ORGANIZATION FOR
VARIOUS DISPLAY MODES AND PANEL
SIZES
It is important to understand which settings affect the
memory map of the video SRAM. This will enable you
to properly display information on the screen. Chapter
3 of the
élan
TM
SC300 Microcontroller Programmer’s
Reference Manual
explains the memory map for Text
mode, how fonts should be set up, and how character
and attribute bytes are organized. It also explains
memory maps for a few different display sizes for
Graphics modes. This section expands on the informa-
tion found in the
élan
TM
SC300 Microcontroller Pro-
grammer’s Reference Manual
. It is meant to show how
screen size and number of banks of video memory—
bits per pixel (graphics) and font size (text)— affect the
display data memory area.
Text Mode
In Text mode, the display data area is 16 Kbyte (for
CGA, B8000h–BBFFFh and for HGA, B0000h–
B3FFFh). Some of the remaining 16 Kbyte of the dis-
play area are used for four different font areas, three
of which are available in CGA Text mode and one of
which is available in HGA Text mode. Refer to
Section 3.4 “Text Mode,” in the élan
TM
SC300 Micro-
controller Programmer’s Reference Manual
, for Text
mode memory map examples.
Graphics Mode
In Graphics mode, the video SRAM memory map is de-
termined by the LCD resolution programmed into the
élanSC300 microcontroller, the number of banks of
memory selected, and the number of bits per pixel re-
quired. Refer to Section 3.3, “Graphics Mode,” in the
élan
TM
SC300 Microcontroller Programmer’s Refer-
ence Manual
, for Graphics mode memory map exam-
ples.
In Graphics mode, the video SRAM memory is split into
8-Kbyte banks. Either two or four 8-Kbyte banks are
used. Refer to "Steps for Determining if a Single-
Screen LCD Panel can be Driven by the élanSC300
Microcontroller" on page 7 to determine how many
banks are needed. The display rows are split evenly
across the banks, as illustrated in the tables on the fol-
lowing page.
The number of bits per pixel and the programmed
screen width determine how many bytes of data per
row are needed. For example, a 128-pixel-wide screen,
at 2 BPP needs 2 · 128 = 256 bits of data per row, and
256 ÷ 8 = 32 bytes of data per row. At 2 bits per pixel,
each pixel can be set to one of four colors. A 128-pixel-
wide screen at 1 BPP needs 1 · 128 = 128 bits of data
per row, and 128 ÷ 8 = 16 bytes of data per row. At
1 BPP, each pixel can be set to only one of two colors.
Thus, more colors require more memory.
Note:
With smaller panels, it may be necessary to pro-
gram the élanSC300 microcontroller’s graphics con-
troller with a logical screen width greater than the
physical screen width of the LCD panel to meet the
panel’s refresh rate requirements. Reminder: if this is
done, it is the logical screen width programmed into the
graphics controller that determines the number of bytes
per row.
The following tables illustrate the memory map for a
128 x 128 pixel display set up for 2 BPP, in both a
two-bank and four-bank configuration. As shown in
the tables, a 128-pixel-wide display at 2 BPP re-
quires 32 bytes of memory per row. If the width of
the display were to increase or decrease, the
change would cause the row ending address and
subsequent starting addresses to increase or de-
crease, respectively.