CFAG320240Cx LCD Not Working

manjurgl

New member
Hai,

I have purchased CFAG320240CX-TFH-T LCD module.When i power it up with 5 V supply it just shows the back light only.I have written correct LCD initialisation code also the code to display characters as specified in the Datasheet.Still i am not able to view anything.What could be the problem? Please suggest me.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:

manjurgl

New member
Sir,

I have checked the Voltage at pin3 and its -18.8V itself and i have verified the intialisation code also.I didnt see any error.What could be the problem? Whether there is any crucial element is there in the LCD circuit that is very sensitive to supply voltage.Can you tell me is there any method to verify the working of all components in the LCD.

Thanks in advance
Manju
 
You also need to verify that the signals from your control cpu are reaching the correct inputs on the display module. This could be done by using a scope, or by writing test code that toggles one control or data line at a time, and measuring with a meter or logic test probe.
 

manjurgl

New member
I checked the control signals coming from the CPU to the LCD by writing a code that toggles between high and low.Is there any way to check the controller in the LCD module.
 
Is there any way to check the controller in the LCD module.
Only by writing commands that cause something to be displayed. Are you using 6800 mode or 8080 mode? Can you post the part of your code that writes data/command bytes to the display?
 

manjurgl

New member
Thank you for your reply.
I am using the 6800 mode

i am using port of the controller to send the control signals to the LCD module and the data signals are from

the data bus of the controller which is given to the LCD module via Latch.

This is my Code.
Code:
void main(void)
 {
	processorInit();

	lcd_init();

while(1);
 }
void lcd_init(void)
 {

	/*LCD Reset*/
	Port=0x0240;			
	 delay(k);	
	Port=0x0300;		/*LCD Reset*/
	 delay(k);
	Port=0x0340;		
	 delay(k);
	
 //lcd_system_set

	lcd_command_write(0x40);			
	lcd_parameter_write(0x30);
	lcd_parameter_write(0x87);
	lcd_parameter_write(0x07);
		
}

void lcd_command_write(char lcd_cw)				   
{
		lcd_latch_address=lcd_cw;
		delay(k);
		Port=0x0340;	// to set the reset,enable and the A0 pin		
		delay(k);
	    	Port=0x0240;		
		delay(k);
}
void lcd_parameter_write(char lcd_data)				
{
		lcd_latch_address=lcd_data;
		delay(k);
		Port=0x0140;
		delay(k);
		Port=0x0040;
		delay(k);
}
 
Please indicate which signals are what bits in your code. "Port=0x0240;" does not mean anything except to you. You should use symbolic names for your constants, so it is easy to understand.
 

manjurgl

New member
Port is 16 bit and 5 pins of the port are dedicated for the control lines.
6th bit of the port is dedicated for RESET
7th bit of the port is dedicated for R/W
8th bit of the port is dedicated for ENABLE
9th bit of the port is dedicated for A0
10th bit of the port is dedicated for CS

All the other bits of the Port are pulled low.

so:
Code:
Port=0x0240

0000001001000000		// BINARY representation of 0x0240
||||||||||||||||
5432109876543210

RESET=1
R/W=0
ENABLE=0
A0=1
CS=0

So this Port=0x0240 will set the RESET bit and A0 high

Port=0x0300

0000001100000000
||||||||||||||||
5432109876543210

RESET=0
R/W=0
ENABLE=1
A0=1
CS=0
Port=0x0300 will set the bit ENABLE and A0 high

Port=0x0340

0000001101000000
||||||||||||||||
5432109876543210

RESET=1
R/W=0
ENABLE=1
A0=1
CS=0

Port=0x0340 will set the bit ENABLE,A0 and RESET high.


Port=0x0140

0000000101000000
||||||||||||||||
5432109876543210

RESET=1
R/W=0
ENABLE=1
A0=0
CS=0

Port=0x0040;

0000000001000000
||||||||||||||||
5432109876543210

RESET=1
R/W=0
ENABLE=0
A0=0
CS=0
These are the pin details of the control lines.

LCD data lines DB0 to DB7 are connected by latch to the controller.

The code above is only a part of the initialization code.

Thanks in advance
Manju
 
Ok, that is more understandable, and your write functions look like they should work. I am assuming that you are using the initialization sample from pages 103~107 of the data sheet.

Do you have pin 19, DISPOFF, set high? Are you able to turn the contrast pot, VR1, and see any change in the active area on the screen?
 

manjurgl

New member
I have pin 19, DISPOFF, set to high. I'm able to change the contrast by varying the pot VR1.

I've referred APPENDIX B: C++ INITIALIZATION CODE EXAMPLE page24 and Initialization Example on page33 of the datasheet.

Thank you
 
At this point, the easy things have been mentioned, and I don't have nearly enough information about your setup to make any specific suggestions. I suspect that the display module is working, but I cannot be sure of that.

I think the most likely source of the problem is either:
1) you have a wiring error, or
2) there is a problem in your code and it is not doing what you expect.

I do not have this particular display, so I cannot help you any further, unless you can give specific details... and maybe I can not help even then.

I would use an oscilloscope or multichannel logic analyzer to verify that the signals are good (not noisy, no ringing, good voltage level, etc.), and make a loop in your code to repeatedly send the init sequence, and watch the scope to see that the timing is within the spec, and the control signal sequence is correct, and that the data pattern on the latch is correct.

BTW, I see the C++ sample on page 24, but I don't see an init example on page 33.

One more thought: maybe your data latch has a problem. Why don't you use 8 bits of your control port (like D0~D7, and move the control signals to other bits), to send data to the display, instead of using the latch? Unless you have already verified that the latch is working correctly..
 
Last edited:

roubic

New member
same problem

hi
i have same problem with cfag320240CX-TFH-T and i realy dont know what to do???
hardware tested with scope and software is ok.but lcd is off!!!
 
Top