Help! I'm stumped. I'm trying, unsuccessfully, to initialize a CFAH4004A-YYH-JP LCD. So far, all I get is black blocks on rows 1 and 3 indicating, I think, that the LCD is not initialized. I'm interfacing the LCD with a Basic Atom Basic Atom Pro 24 microprocessor using the Basic Atom syntax for LCDINIT and LCDWRITE commands. As shown in the Basic Atom Syntax Manual, the commands are pretty straightforward, and the only modification I've made to my initialization code is to accomodate the two Enable pins for the LCD. I've checked the cabling and output from the microprocessor and have good connections and can cycle all the Enable and Data pins through a high and low sequence. The LCD is being initialized in 4-bit mode, so I've included three LCDINIT commands for each of the HD44780 controllers as showm in the CFAH4004A Manual. I've also tried "strobing" the Enable pins before the LCDINIT commands are invoked. All of this, has not initialized the LCD. Would anyone of this Forum's members tell me what I should try next. A copy of my initialization code is shown below.
Code:
;Display Test - Hello World 2
;PIN CONNECTIONS
;AtomPro-P1 is LCD pin 11 RegSel (R/S)
;AtomPro-P3 is LCD pin 9 Clk1 (E1)
;AtomPro-P0 is LCD pin 15 Clk2 (E2)
;AtomPro-P7 is LCD pin 1 Data Line 7
;AtomPro-P6 is LCD pin 2 Data Line 6
;AtomPro-P5 is LCD pin 3 Data Line 5
;AtomPro-P4 is LCD pin 4 Data Line 4
;AtomPro-P2 is LCD pin 10 RdWr
;LCDWRITE MODIFIER CONSTANTS
INITLCD1 CON $133
INITLCD2 CON $132
TWOLINE CON $128
LCDCLEAR CON $101
LCDHOME CON $102
SCR CON $10C
;STROBE LCD ENABLE LINES
HIGH P3 ;LCD ROWS 1 & 2, E1
PAUSE 500
LOW P3
PAUSE 500
HIGH P3
PAUSE 500
LOW P3
HIGH P0 ;LCD ROWS 3 & 4, E2
PAUSE 500
LOW P0
PAUSE 500
HIGH P0
PAUSE 500
LOW P0
;LCD INITIALIZATION
pause 500 ;PAUSE FOR LCD START
lcdinit P1\P3\P7\P6\P5\P4,P2 ;INITIALIZE LCD ROWS 1 AND 2
pause 500
lcdinit P1\P3\P7\P6\P5\P4,P2
pause 500
lcdinit P1\P3\P7\P6\P5\P4,P2
pause 500 ;PAUSE FOR LCD START
lcdinit P1\P0\P7\P6\P5\P4,P2 ;INITIALIZE LCD ROWS 3 AND 4
pause 500
lcdinit P1\P0\P7\P6\P5\P4,P2
pause 500
lcdinit P1\P0\P7\P6\P5\P4,P2
pause 500 ;PAUSE FOR LCD TO INITIALIZE
lcdwrite P1\P3\P7\P6\P5\P4,P2,[INITLCD1,TWOLINE,LCDCLEAR,LCDHOME,SCR]
lcdwrite P1\P0\P7\P6\P5\P4,P2,[INITLCD2,TWOLINE,LCDCLEAR,LCDHOME,SCR]
Main
lcdwrite P1\P3\P7\P6\P5\P4,P2,[SCRRAM+$00,"-----HELLO WORLD------------------------"]
lcdwrite P1\P3\P7\P6\P5\P4,P2,[SCRRAM+$40,"-----------------HELLO WORLD------------"]
lcdwrite P1\P0\P7\P6\P5\P4,P2,[SCRRAM+$00,"------------HELLO WORLD-----------------"]
lcdwrite P1\P0\P7\P6\P5\P4,P2,[SCRRAM+$40,"-------Brisbane Valley Observatory------"]
goto Main
end
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.