Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/13/03 11:53
Read: times


 
#41415 - RE: hd44780 specification
Responding to: ???'s previous message

Yes you need to initialize the LCD before it can do anything useful(except irritating you.)

I use these initialization bytes:

FSET EQU 38H ; L=1(8 BITS),N=1(2LINE) ; 001L N000
DCB EQU 0CH ; Dis.on=1,Cur.off=0,Blink off=0; 0000 1DCB
RH EQU 02H ; Ret.Home ; 0000 0010 (No need to initialize)
CLER EQU 01H ; Clr. Disp; 0000 0001
SDD1 EQU 80H ; Set DDRAM address line 1; 1000 0000 (No need to initialize)
SEM EQU 06H ; Entry mode; Inc=1, Shift=0; 0000 01IS
DCON EQU 18H ; Dis & Cur control.DiS shift=1,Leftwise=0; 0001 SL00 (No need to initialize )


The actual Init routine is this :

LCDSET: MOV A,#FSET ; LCD Init routine
LCALL LCDCOM
LCALL DLY_5MS
MOV A,#DCB
LCALL LCDCOM
MOV A,#SEM
LCALL LCDCOM
MOV A, #CLER
LCALL LCDCOM
LCALL DLY_5MS ; 5 mS required for clear
RET

LCDCOM: MOV P2,#ADD_H ; Write to LCD Command register
MOV R0,#LCD_C
MOVX @R0,A
DELAY: MOV R3,#50 ; 100 Micros delay for each write
DLOOP: DJNZ R3, DLOOP
RET

LCDCHR: MOV P2,#ADD_H ; Send one character to LCD
MOV R0,#LCD_D
MOVX @R0,A
LCALL DELAY
RET

Just align the tabs in the code and it will make sense. I use this for the Hitachi 44780

Hope this helps.

Raghu

List of 7 messages in thread
TopicAuthorDate
hd44780 specification            01/01/70 00:00      
   RE: hd44780 specification            01/01/70 00:00      
   RE: hd44780 specification            01/01/70 00:00      
   Found good docs            01/01/70 00:00      
   RE: hd44780 specification            01/01/70 00:00      
      RE: hd44780 specification            01/01/70 00:00      
   RE: hd44780 specification            01/01/70 00:00      

Back to Subject List