CFAG14432D using GDRAM and DDRAM

aleks

New member
I am using CFAG14432D and trying to display simultaneously the graphic image (on the left part of the screen) and text from CGROM (on the right part of the screen). Please correct me if I am wrong, but it seems like ST7920 controller only supports text from CGROM/HCGROM mapped to DDRAM or Graphic RAM(GDRAM).
Do I need use initialization with extended commands to use Graphic RAM?
So far I can display ether text or graphic sequentially (but not at the same time).
Another question: how do I switch from graphic to text and back. Currently it works for me only if I issue initialization:

For text mode:

Code:
void GLCD_Init(void)  // Text mode???
{
GLCD_WriteByte (RS_INSTR, 0x30); // Specify 8 bit interface and basic instruction set.
Wait_mS (1);
GLCD_WriteByte (RS_INSTR, 0x06); // Specify 8 bit interface and basic instruction set.
Wait_mS (1);
GLCD_WriteByte (RS_INSTR, 0x0C); // Specify Display on, Cursor off and Blink off.
Wait_mS (1);
GLCD_WriteByte (RS_INSTR, 0x01); // Display clear. Fill DDRAM with "20H", and set DDRAM address counter to "00H"
Wait_mS (10);
GLCD_WriteByte (RS_INSTR, 0x02); // AC Increase (cursor move right), don't shift the display.
Wait_mS (1);
GLCD_WriteByte (RS_INSTR, 0x80); // Select extended instruction set.
Wait_mS (1);
GLCD_WriteByte (RS_INSTR, 0x30); // Graphic display ON.
Wait_mS (1);   
 }
Reinitialization for graphic:

Code:
void GLCD_Init_Text(void)
{
	
GLCD_WriteByte (RS_INSTR, 0x30); // Specify 8 bit interface and basic instruction set.
Wait_mS (2);
		
	
GLCD_WriteByte (RS_INSTR, 0x06); // Cursor move to right ,DDRAM address counter (AC) plus 1
Wait_mS (2);
GLCD_WriteByte (RS_INSTR, 0x0C); // Display on, cursor on, blink on 
Wait_mS (2);
GLCD_WriteByte (RS_INSTR, 0x01); // Fill DDRAM with "20H", and set DDRAM address counter to "00H" 
Wait_mS (10);
GLCD_WriteByte (RS_INSTR, 0x02); // Set DDRAM address counter (AC) to "00H", and put cursor to
			    					 //  origin the content of DDRAM are not changed 
Wait_mS (2);
GLCD_WriteByte (RS_INSTR, 0x80); // Set DDRAM address to address counter (AC) 
Wait_mS (2);

// Set Extended function set
GLCD_WriteByte (RS_INSTR, 0x30); // Select extended instruction set.
Wait_mS (2);
GLCD_WriteByte (RS_INSTR, 0x32); // Graphic ON
Wait_mS (2);
GLCD_WriteByte (RS_INSTR, 0x36); // Select extended instruction set.
Wait_mS (2);
}
What is correct way to do it?

Thanks.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Support

Administrator
A cursory look at your code would say that you're doing it correctly for switching between text and graphics.

You would certainly have to use the extended command set to do graphics, I believe that's the only way to get that to work at all.

As far as switching between the two, you would have to use the initialization commands to do so, unless I am mistaken.
 
Top