
Configuring the élanSC300 Device’s Internal CGA Controller for a Specific LCD Panel
3
Gray Shading (Gray Scaling)
Gray shading is a way of representing colors on a
monochrome LCD display using shades of gray. The
IRGB color information for each pixel is used to deter-
mine which gray shading algorithm will be used to dis-
play that pixel. The gray shading algorithm can be
thought of as the duty cycle for displaying a particular
pixel. For example, on the élanSC300 microcontroller,
an IRGB value of 1011 corresponds to a 1/3 duty cycle.
This means that, if a pixel is supposed to be displayed,
it would be displayed once for every three times the
screen is refreshed. Refer to Table 3 on page 6 for a list
of the élanSC300 microcontroller’s IRGB values and
their corresponding gray shading duty cycles.
élanSC300 MICROCONTROLLER
EXTENSIONS TO THE CGA AND HGA
STANDARDS
CGA Standard
The CGA standard was defined for a color CRT monitor
with a resolution of 640 x 200 pixels. The CGA stan-
dard defines two graphic resolutions:
1. 640 x 200 pixels, with two colors, represented by
1 BPP.
2. 320 x 200 pixels, with four colors, represented by
2 BPP. In 320 x 200 mode, each pixel in the x di-
mension is displayed twice.
For both 640 x 200 and 320 x 200 resolutions, the
memory is divided into two 8-Kbyte banks. Pixel data
for even-numbered display rows (starting with 0) are
stored in bank 0, address range B8000–B9FFF. Pixel
data for odd-numbered display rows are stored in bank
1, address range BA000–BBFFF. The Graphics mode
section of Chapter 3 in the élan
TM
SC300 Microcontrol-
ler Programmer’s Reference Manual
helps illustrate
this.
In Text mode, 16 colors are available for characters. Text
mode is discussed in detail in Chapter 3 of the
élan
TM
SC300 Microcontroller Programmer’s Reference
Manual
and follows the CGA standard implementation;
therefore, it will not be discussed in detail in this docu-
ment.
How the élanSC300 Microcontroller
Deviates from the CGA Standard
The élanSC300 microcontroller can support any com-
bination of resolutions at either 1 or 2 BPP (two or four
colors), provided the video SRAM requirements do not
exceed 32 Kbyte. For memory requirements greater
than 16 Kbyte, the élanSC300 microcontroller can be
programmed to use three, or even all four, of the 8-
Kbyte banks of video SRAM. If all four banks are used:
I
The pixel data for display rows 0, 4, 8,... are in
bank 1 (address range B8000–B9FFF).
I
The pixel data for display rows 1, 5, 9,... are in
bank 2 (address range BA000–BBFFF).
I
The pixel data for display rows 2, 6, 10,... are in
bank 3 (address range BC000–BDFFF).
I
The pixel data for display rows 3, 7, 11,... are in
bank 4 (address range BE000–BFFFF).
Note that two banks are the minimum. Thus, even if the
pixel data for a small LCD screen could fit in 8 Kbyte
(for example, 320 x 200 in 2-color mode), two banks
must still be used.
In 4-color Graphics mode (2 BPP), it is possible to se-
lect whether or not pixels are doubled in the x dimen-
sion. (In the CGA standard, the pixel doubling is
automatic in 4-color Graphics mode.) If the élanSC300
microcontroller graphics control is set to display 2-BPP
graphics (Port 3D8h bit 4 = 0), and if Video Index 20h
bit 5 = 0, two pixels are displayed, effectively cutting the
horizontal resolution in half. If Video Index 20h
bit 5 = 1, only one pixel is displayed.
In CGA Text mode, the élanSC300 microcontroller gets
its fonts from SRAM rather than ROM and can support
multiple font areas. The character width is fixed at eight
pixels, but the character height is programmable. The
way the font areas are addressed is discussed in detail
in Chapter 3 of the élan
TM
SC300 Microcontroller Pro-
grammer’s Reference Manual
.
HGA Standard
The HGA standard was defined for a high-resolution,
monochrome CRT with a resolution of 720 x 348 pixels.
In Graphics mode, this allows two colors (black and
white) represented by 1 BPP. The standard implemen-
tation is to use four 8-Kbyte banks of video SRAM in
the same way the élanSC300 microcontroller handles
the four-bank CGA configuration. In the case of HGA,
the standard address range for bank 1 is B0000–
B1FFF, for bank 2 it is B2000–B3FFF, for bank 3 it is
B4000–B5FFF, and for bank 4 it is B6000–B7FFF. The
HGA standard also supports a second 32-Kbyte dis-
play page at B8000.
In Text mode, three character colors are available:
black, light gray, and white.
How the élanSC300 Microcontroller
Deviates from the HGA Standard
The élanSC300 microcontroller can support any com-
bination of resolutions, provided the video SRAM re-
quirements do not exceed 32 Kbyte. For memory
requirements of 16 Kbyte or less, the élanSC300 mi-
crocontroller can be configured to use only two 8-Kbyte
banks of memory. For memory requirements of 16–
24 Kbyte, the élanSC300 microcontroller can be con-
figured to use only three 8-Kbyte banks of memory.