JJ Richard
New member
I'm trying to get a CFAG12864B-YYH-V working via programming a PIC16F877 uP (this is the 128X64 LCD w/the negative voltage converter).
I've been programming the 16X2 LCD's for a while, and have had success with them, but this 128X64 graphic LCD is giving me fits. After hours of trying tonight, I've yet to even get a single dot to display on the screen.
First of all, I'm not sure what the LCD operating voltage (on pin 3) is supposed to be.
Under section 5 of the data sheet, the "Supply Voltage for LCD" is listed as 7.5v minimum, 8.5V typical, and 9.5V max.
However, under section 4 of the same data sheet, it lists the "Supply Voltage for LCD" as variable from 0 to 16.7V.
Until I figure this out, I really don't know whether my code is bad, or if the LCD just isn't powered up, since I'm applying 5V (through a 2.2Kohm resistor) to LCD Voltage Pin (pin 3). I tried briefly touching 9V to pin 3, at which point the backlighting dimmed (as if in protest), and my logic high voltage (from the PIC) dropped from 5V to ~3.8V, so I quickly removed the 9V from pin 3.
So, that's the first question... what's the proper voltage that is to be applied to pin3?
The second question is this:
I'm using an 8-bit interface to communicate between the PIC and the LCD.
Referencing the datasheet, I wrote the following code:
;----------Constants-----------------------------------
CS1 CON E2 'Assign LCD constants to PIC pins
CS2 CON E1
RST CON E0
RW CON A5
DI CON A3
E CON A2
;========Main Program================
TRISE = $00 'Make portE pins outputs (E0 thru E2)
TRISC = $00 'Make portC pins outputs (C0 thru C7)
low E 'Put a low on enable pin
High RST 'De-select Reset Mode
portC = 0 'Send all zero's to ensure Reset mode off.
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
low RW 'Put LCD in write mode
low CS1 'Select column 1 ~ 64
high CS2 'De-select columns 65 ~ 128
main:
InitLCD:
low DI 'Set LCD to receive instructions
PortC = %00111111 'Turn display on
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %01000000 'Set Y address to zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %10111000 'Set page address to page zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %11000000 'Set display start line to line zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
high DI 'Set LCD to receive characters
DisplaySomething:
PortC = $41 'Character code for the letter A
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 100 'pause 100ms
goto DisplaySomething 'Continue printing A's forever
This code produces zero output on the LCD.
If anyone is familiar with PICs and can offer some suggs, I'd appreciate it. Or if anyone knows of a basic "LCD Initialization" routine (if that's what I'm missing, etc..), all the better...
I've double checked my wiring interface (DBO is connected to C0, DB1 is connected to C1, etc..) and read the logic states with a DMM, and the PIC is producing the correct data output to the DB0...DB7 pins.
Tks,
JJ
I've been programming the 16X2 LCD's for a while, and have had success with them, but this 128X64 graphic LCD is giving me fits. After hours of trying tonight, I've yet to even get a single dot to display on the screen.
First of all, I'm not sure what the LCD operating voltage (on pin 3) is supposed to be.
Under section 5 of the data sheet, the "Supply Voltage for LCD" is listed as 7.5v minimum, 8.5V typical, and 9.5V max.
However, under section 4 of the same data sheet, it lists the "Supply Voltage for LCD" as variable from 0 to 16.7V.
Until I figure this out, I really don't know whether my code is bad, or if the LCD just isn't powered up, since I'm applying 5V (through a 2.2Kohm resistor) to LCD Voltage Pin (pin 3). I tried briefly touching 9V to pin 3, at which point the backlighting dimmed (as if in protest), and my logic high voltage (from the PIC) dropped from 5V to ~3.8V, so I quickly removed the 9V from pin 3.
So, that's the first question... what's the proper voltage that is to be applied to pin3?
The second question is this:
I'm using an 8-bit interface to communicate between the PIC and the LCD.
Referencing the datasheet, I wrote the following code:
;----------Constants-----------------------------------
CS1 CON E2 'Assign LCD constants to PIC pins
CS2 CON E1
RST CON E0
RW CON A5
DI CON A3
E CON A2
;========Main Program================
TRISE = $00 'Make portE pins outputs (E0 thru E2)
TRISC = $00 'Make portC pins outputs (C0 thru C7)
low E 'Put a low on enable pin
High RST 'De-select Reset Mode
portC = 0 'Send all zero's to ensure Reset mode off.
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
low RW 'Put LCD in write mode
low CS1 'Select column 1 ~ 64
high CS2 'De-select columns 65 ~ 128
main:
InitLCD:
low DI 'Set LCD to receive instructions
PortC = %00111111 'Turn display on
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %01000000 'Set Y address to zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %10111000 'Set page address to page zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 1 'pause 1ms
PortC = %11000000 'Set display start line to line zero
pulsout E,1 'Send high pulse to Enable pin (for 10us)
high DI 'Set LCD to receive characters
DisplaySomething:
PortC = $41 'Character code for the letter A
pulsout E,1 'Send high pulse to Enable pin (for 10us)
pause 100 'pause 100ms
goto DisplaySomething 'Continue printing A's forever
This code produces zero output on the LCD.
If anyone is familiar with PICs and can offer some suggs, I'd appreciate it. Or if anyone knows of a basic "LCD Initialization" routine (if that's what I'm missing, etc..), all the better...
I've double checked my wiring interface (DBO is connected to C0, DB1 is connected to C1, etc..) and read the logic states with a DMM, and the PIC is producing the correct data output to the DB0...DB7 pins.
Tks,
JJ
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.