Department of Computer Science and Information EngineeringNational Cheng Kung University, TAIWAN8255 HANEL
INTERFACINGLCD
Connection To The 8255(cont
;Writing commands to the LC’)
D without checking busy flag
;PA of 8255 connectedto D0-D7 of LCD and;PB0=RS, PB1=R/W, PB2=E for 8255 to LCD’s control pins connectionMOV A,#80H ;all 8255 ports as outputMOV R0,#CNTPORT ;loadcontrol reg addressMOVX @R0,A ;issue control wordMOV A,#38H ;LCD:2 LINES, 5X7 matrixACALL NCMDWRT ;write command to LCDMOV A,#0EH ;LCD command for cursor onACALL NCMDWRT ;write command to LCDMOV A,#01H ;clear LCDACALL NCMDWRT ;write command to LCDMOV A,#06H ;shift cursor right commandACALL NCMDWRT ;write command to LCD.... ;etc. for all LCD commandsMOV A,#’N’ ;display data (letter N)ACALL NDATAWRT ;send data to LCD displayMOV A,#’O’ ;display data (letter O)CALL NDATAWRT ;send data to LCD display.... ;etc. for other dataProgram 15-2.