Hello - I am new to GLCD programming, and am having trouble getting anything to display on my screen (front view CFAG19264A-STI-TN). I am programming in C on a PSoC. When I connect my circuit to power, the entire screen lights up to the same brightness. I do not know whether to think this all pixels showing or no pixels showing.
On the PSoC I have the 8 data lines to the LCD connected to port 2 so that data[7] corresponds to P2[7], etc.
Also, I have the control pins connected to port 1 of the PSoC as follows:
P1[7] = E
P1[6] = R/W
P1[5] = RS
P1[4] = RST
P1[3] =
P1[2] = CS3
P1[1] = CS2
P1[0] = CS1
Lastly, the remainder of the LCD pins are connected as follows:
Vss = ground
Vdd = 5V
Vo = middle pin of a 100K pot (one side to Vss, other side to Vee)
Vee = as just said, to one side of the pot
A = 2.75V
**update** I have adjusted the voltage on pin A from 5 V to 2.75 V. This looks much better! The screen now looks like the one is the picture, only blank. Initially the screen was very bright. **update**
First, am I overlooking anything in this layout?
Secondly, please look at my C code and help me see if the problem is there. Is this the correct process for outputting some simple data to the screen?
Thank You!
On the PSoC I have the 8 data lines to the LCD connected to port 2 so that data[7] corresponds to P2[7], etc.
Also, I have the control pins connected to port 1 of the PSoC as follows:
P1[7] = E
P1[6] = R/W
P1[5] = RS
P1[4] = RST
P1[3] =
P1[2] = CS3
P1[1] = CS2
P1[0] = CS1
Lastly, the remainder of the LCD pins are connected as follows:
Vss = ground
Vdd = 5V
Vo = middle pin of a 100K pot (one side to Vss, other side to Vee)
Vee = as just said, to one side of the pot
A = 2.75V
**update** I have adjusted the voltage on pin A from 5 V to 2.75 V. This looks much better! The screen now looks like the one is the picture, only blank. Initially the screen was very bright. **update**
First, am I overlooking anything in this layout?
Secondly, please look at my C code and help me see if the problem is there. Is this the correct process for outputting some simple data to the screen?
Code:
void main()
{
GLCD_reset();
GLCD_Display(1);
GLCD_write_data(0,0x66);
GLCD_write_data(1,0x66);
}
Code:
void GLCD_reset()
{
int i;
PRT1DR = 0x00; // pull down reset
for( i = 0; i < 10000; i++ ); // delay
PRT1DR = 0x17; //binary = 0001 0111
}
void GLCD_Display( BOOL on )
{
BYTE x = 0x3E | (on & 1); //0011 1110
GLCD_write_ins( 0, x );
GLCD_write_ins( 1, x );
GLCD_write_ins( 2, x );
}
void GLCD_write_ins( BYTE drv, BYTE ins )
{
switch(drv){
case 0:
PRT1DR = 0x16; //0001 0110
break;
case 1:
PRT1DR = 0x15; //0001 0101
break;
case 2:
PRT1DR = 0x13; //0001 0011
break;
default:
PRT1DR = 0x16; //0001 0110 same as case 0
break;
}
PRT0DR = ins; // write instruction
PRT0DM0 = 0xFF; // turn on port 0's output - strong mode
PRT0DM1 = 0x00;
PRT1DR |= 0x80; // turn E on
PRT1DR &= 0x7F; // turn E off
}
void GLCD_write_data( BYTE drv, BYTE data )
{
switch(drv){
case 0:
PRT1DR = 0x36; //0011 0110
break;
case 1:
PRT1DR = 0x35; //0011 0101
break;
case 2:
PRT1DR = 0x33; //0011 0011
break;
default:
PRT1DR = 0x36; //0011 0110 same as case 0
break;
}
PRT0DR = data; // write data
PRT0DM0 = 0xFF; // turn on port 0's output - strong mode
PRT0DM1 = 0x00;
PRT1DR |= 0x80; // turn E on
PRT1DR &= 0x7F; // turn E off
}
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
Last edited: