Lcd cfag128128a check status

kmilitog

New member
I'm using the CFAG128128A, but i can not pass the check status part, i am working with an ATmega16 and my code is the following

Code:
int status_check (void)
{
	
	LCD_DDR = 0x00; //Puerto LCD queda asignado como entrada

	LCD_CON_PORT |= (1<<LCD_CD);
	LCD_CON_PORT &= ~(1<<LCD_RD);
	LCD_CON_PORT &= ~(1<<LCD_CE);
	_delay_us(1);

	status = LCD_PORT;
	PORTA = status;

	LCD_CON_PORT |= (1<<LCD_CE);
	LCD_CON_PORT |= (1<<LCD_RD);

	LCD_DDR = 0xFF; //Puerto LCD queda asignado como salida

	return (status);
}

void data_write (unsigned char data_byte)
{
	do{} while ((0x03 & status_check()) != 0x03);
	_delay_ms(1);
	LCD_CON_PORT &= ~(1<<LCD_CD);
	LCD_CON_PORT &= ~(1<<LCD_WR);
	LCD_PORT = data_byte;
	LCD_CON_PORT &= ~(1<<LCD_CE);

	_delay_us(1);

	LCD_CON_PORT |= (1<<LCD_CE);
	LCD_CON_PORT |= (1<<LCD_WR);
	return;
}
I'm pretty sure the code is ok, and when i checked the pins STA0 and STA1 of the LCD, their voltage were around 1.9V, i think this is the problem, it is not a logic "1", anyone know why could be this happening?
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:
Top