
Configuring the élanSC300 Device’s Internal CGA Controller for a Specific LCD Panel
9
I
(CS = Cursor Start Row –1)
(CE = Cursor End Row –1)
The Cursor Start Register (Index 0AH), and Cursor
End Register (Index 0BH) define the pixel rows
within a font where the cursor will be displayed. Typ-
ically, the cursor is defined to be near the bottom of
the character matrix. For example, an 8 x 10 font
has 10 pixel rows. Therefore, to have the cursor po-
sitioned at rows 8 and 9, CS = 8 – 1 = 7, and CE =
9 – 1 = 8.
Note:
Bits 6 and 5 of the Cursor Start Register (Index
0AH) control the cursor’s behavior. See Table 4.
I
(SAH) (SAL)
The Start Address High (Index 0CH) and Start Ad-
dress Low (Index 0DH) Video Indexes together
form a 14-bit offset (bits 7 and 6 of Index 0CH are
not used) that determines the location in video
memory where the video controller will start fetching
data to be displayed on the screen. Typically, these
indexes will be set to 0 so the display data starts
being fetched from B8000h. Scrolling can be imple-
mented by changing the values in these registers.
I
(CAH) (CAL)
Cursor Address High (Index 0EH) and Cursor Ad-
dress Low (Index 0FH) Video Indexes together form
a 14-bit offset (bits 7 and 6 of Index 0CH are not
used) that determines the location in video memory
where the video controller will display the cursor
when the corresponding video data is displayed on
the screen. For example, if SAH = 0, SAL = 0, CAH
= 0, and CAL = 0, the cursor will be displayed in the
upper left corner of the screen.
I
All the other index registers (02, 03, 05, 08, 0Ah,
0Bh, 0Eh, 0Fh) will be programmed with 0h.
Initializing the Video Controller
The following sequences show the proper sequence
for initializing the video controller. The following steps
assume the video controller is set up to its default mode
of CGA and the Video Index registers are unlocked. (To
unlock the video registers, write 12h to Port 3D4h, and
read Port 3D5h with no I/O cycles between these.)
Note:
Only the minimum set of registers required to
get the screen running are initialized. There are a num-
ber of additional features such as auto screen blanking
and text truncation that are discussed in the
élan
SC300 Microcontroller Programmer’s Reference
Manual
that are not reiterated in this document.
CGA Graphics
The Video Index registers are accessed by writing the
register index to Port 3D4h, and then writing or reading
the register data to or from Port 3D5h.
1. Set Video Index 18H = 50h
– Sets up LCD panel type to single screen (bits 7
and 6)
– Sets display type to LCD (bit 4)
2. Set Video Index 00H = HT
3. Set Video Index 01H = HT
4. Set Video Index 02H = 0
5. Set Video Index 03H = 0
6. Set Video Index 04H = VT
7. Set Video Index 05H = 0
8. Set Video Index 06H = VT
9. Set Video Index 07H = VT
10.Set Video Index 08H = 0
11.Set Video Index 09H = MSL
12.Set Video Index 0AH = 0
13.Set Video Index 0BH = 0
14.Set Video Index 0CH = SAH
15.Set Video Index 0DH = SAL
16.Set Video Index 0EH = 0
17.Set Video Index 0FH = 0
18.Set Video Index 20H (bit 5 controls dot doubling)
– If 2 BPP Graphics mode is used, set bit 5 = 1 to
disable dot doubling.
Note:
This is the common setting.
– If 2 BPP Graphics mode is used, and dot dou-
bling is desired (CGA standard), then set bit 5 =
0.
19.If Color Mapping is going to be used:
– Set Video Index’s 14H–17H and 1CH–1FH
accordingly
– Set Video Index 19H = 10H
20.Set Video Port 3D8H
– If 2 BPP Graphics mode, set to 0AH
– If 1 BPP Graphics mode, set to 1AH
21.Set Video Port 3D9H
– Set colors accordingly (see the register descrip-
tion in the élan
TM
SC300 Microcontroller Pro-
grammer’s Reference Manual
)
Table 4.
Cursor Control Bits (Index 0AH)
Bit 6
0
0
1
1
Bit 5
0
1
0
1
Cursor Behavior
No blinking
Cursor not displayed
Blinking with 16 · refresh rate
Blinking with 32 · refresh rate