ST7066U
$" Initial Program Code Example For 8051 MPU(8 Bit Interface):
;---------------------------------------------------------------------------------
INITIAL_START:
CALL DELAY40mS
MOV A,#38H
;FUNCTION SET
CALL WRINS_NOCHK ;8 bit,N=1,5*7dot
CALL DELAY37uS
MOV A,#38H
;FUNCTION SET
CALL WRINS_NOCHK ;8 bit,N=1,5*7dot
CALL DELAY37uS
MOV A,#0FH
;DISPLAY ON
CALL WRINS_CHK
CALL DELAY37uS
MOV A,#01H
;CLEAR DISPLAY
CALL WRINS_CHK
CALL DELAY1.52mS
MOV A,#06H
;ENTRY MODE SET
CALL WRINS_CHK
CALL DELAY37uS
;CURSOR MOVES TO RIGHT
;---------------------------------------------------------------------------------
MAIN_START:
XXXX
XXXX
XXXX
XXXX
.
.
.
.
;---------------------------------------------------------------------------------
WRINS_CHK:
CALL CHK_BUSY
WRINS_NOCHK:
CLR
CLR
SETB
RS
RW
E
;EX:Port 3.0
;EX:Port 3.1
;EX:Port 3.2
MOV P1,A
CLR
;EX:Port 1=Data Bus
E
MOV P1,#FFH
RET
;For Check Busy Flag
;---------------------------------------------------------------------------------
CHK_BUSY:
CLR
;Check Busy Flag
RS
SETB RW
SETB
JB
CLR
RET
E
P1.7,$
E
V2.0
2001/03/01
24/42