• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

CFAG320240CX Memory Read

will1234

New member
Hello,

Has anyone managed to get a memory read to a CFAG320240CX to work correctly? I am currently using the following code without much luck:

Code:
unsigned char DATA_R(void)
{
	unsigned char iData;

	GPIOE->CRH = 0x44444444;	//Set Data bus to input
	CLR_A0;
	CLR_CS;
	LCD_READ;                         //Set R/W bit	
	Sleep();

	SET_E;
	Sleep();
 	CLR_E;
	iData = INDATA();

	GPIOE->CRH = 0x11111111;   //Return data bus to output
	LCD_WRITE;                        //Clear R/W bit
	return ( iData );
}
The sleep function here should delay for around 13ns. Memory writes to the controller work as expected.

Thanks,
Will.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited by a moderator:

CF Support

Administrator
Ts is 100nS

If you see page 64/65 of the datasheet it tells the minimum delays.

For example, RW# pulse active time = 500nS minimum
 
I believe you need to sample the data on the bus while the strobe is high, not after it goes low.
Code:
	SET_E;		// enable data to the bus
	Sleep();	// wait for data to settle
	iData = INDATA();	// read it
 	CLR_E;			// disable data output
 
Top