I've tried to use an HD7780 LCD screen with an AVR ATmega8 (4-bit interfacing). I used the exact same code as on https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=281379#281379 (except that I changed the ports to reflect my own setup). However, something strange happens. When I turn the power on, I see two lines of black squares. When I turn the power off, the black boxes disappear and in a flash I the text "4-bit avr-gcc" appears on the first row, which is the one it is supposed to be showing. The text only stays for a couple of ms I guess, then it disappears as well as the power is turned off. So I know the connections are right, and also the initialization must be ok (I assume you can't send characters over unless the display is initialized?). I don't konw what the problem might be. Anyone knows?