This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Random problem with LCD.

I have a microcontroller (philips P89c51RD2) at 12MHz, reads data by serial port and shows them by display LCD.
The problem is that when turn-on the circuit, sometimes the LCD does not work, as if microcontroller was not connected. The LCD shows the first and third row in black and second and fourth in white.
I think that as the problem only sometimes happens, could be problem of time to initialisation of the LCD, but I have put a loop at the beginning of the program and the problem persists.
I show the principle of the code, where the LCD is initialized.

void main(void)
{
	.
	.
	.
	.
	for(i=0;i<6500;i++);
	config_RS232();

// ***** Init LCD ******* //
	for(i=0;i<40000;i++);
	lcd_reset();
	for(i=0;i<40000;i++);
	lcd_reset();
	for(i=0;i<6500;i++);
// ************ //
	.
	.
	.

I do not know that it happens, whichever help to me will be very useful.

Thanks.
Germán

0