I picked up a 20x4 GDM2004D (HD44780 compatible) from sparkfun the other day and I've been able to write text to all 4 lines however when I attempt to clear the display I just get 2 rows of all black squares.
Here is an outline of how I'm attempting to clear the display:
// Bring RS/RW/E Low PORTB = 0x00; _delay_ms(40); // send clear display command PORTD = 0x01; _delay_ms(40); // Bring E high PORTB = (1 << PB2); _delay_ms(40); // Bring E low PORTB &= ~(1 << PB2); _delay_ms(40); // Bring RS/RW High PORTB |= (1 << PB0) | (1 << PB1);
The long delays are just there for testing purposes. I figure I must be sending this command the wrong way. Can anyone shed a little light on where I'm going wrong here?