S1C88348/317/316/308 TECHNICAL SOFTWARE
EPSON
II-89
13 LCD CONTROLLER
(1)
Source List
Control of LCD controller
public
lcd_init,display_frame,display_1ch
;
offset
equ
30h*5
;ascii code table address offset
br_io
equ
0ffh
;base reg.address (set i/o area)
lcd_mode0
equ
00ff10h
;lcd controller mode set reg. 0
lcd_mode1
equ
00ff11h
;lcd controller mode set reg. 1
hzr2
equ
00ff71h
;r2x output control data
r2d
equ
00ff75h
;r2x output data
;
lcd_ram0
equ
00f800h
;lcd ram line 0 top address
lcd_ram1
equ
00f900h
;lcd ram line 1 top address
lcd_ram2
equ
00fa00h
;lcd ram line 2 top address
lcd_ram3
equ
00fb00h
;lcd ram line 3 top address
;
code
(1) Initialization for LCD controller
;************************************************************************
;*
*
;*
lcd display control
*
;*
*
;************************************************************************
;*** initialize routine
lcd_init:
ld
br,#br_io
;set br reg. address to 0ffxxh
or
[br:low r2d],#01100000b
;r26,r25="h" (fr,cr enable)
and
[br:low hzr2],#1001111b
;r26,r25=complementary output
;lcclk,lcfrm=on,dttyp=5*8,lduty=1/32
ld
[br:low lcd_mode0],#00011000b
;srsel=don't care (when 1/32),lcdc=normal,lc=middle contrast
ld
[br:low lcd_mode1],#00011000b
ret
;
(2) Display control
;************************************************************************
;*** control program example routine
control_example:
ld
ix,#loc frame00
;display message
ld
iy,#lod lcd_ram0+1*5
;display address
carl
display_frame
;display frame ***
;
(user program)
;
;************************************************************************
;*
*
;*
dispaly frame
*
;*
ix : message top address
*
;*
iy : display top address
*
;*
*
;************************************************************************
;*** control routine
display_frame:
ld
a,[ix]
cp
a,#00h
;end mark ?
jrs
z,display_frame00
;exit
;
cars
display_1ch
;display 1 character ***
inc
ix
add
iy,#5
;display address + 5 (5*8 dots)
jrs
display_frame
;up end
mark detect
;
display_frame00:
ret
(2)