Problem with mega128 and LCD (black boxes)

i purchased one of the 16x2 HD44780 LCD’s from sparkfun, and i’m having a heck of a time getting it to work with my atmega128 development board.

i’m using bascom to compile the program, and get no errors, but when the program is flashed to the uC, only the first row of black boxes is seen. even after adjusting the contrast, no text is visible.

i’ve tested continuity between pins on the LCD all the way to pins on the uC, i’m positive they go where they’re supposed to. also, i have the R/W hardwired to ground. is there something that i’m doing wrong in the code?

some things i have commented out, to see if it made a difference

any help would be appreciated, thank you

$regfile = "m128def.dat"
$crystal = 1000000
'$sim
'$lib "lcd4.lbx"                                  ' use the alternative library

Config Porta = Output

Config Lcdpin = Pin , Rs = Porta.6 , E = Porta.4 , Db4 = Porta.3 , Db5 = Porta.2 , Db6 = Porta.1 , Db7 = Porta.0

Config Lcd = 16 * 2
'Config Lcdmode = Port

'Reset  PORTC.0
'set portc.2
'Reset Porta.5                            'sets the LCD to write mode

'Main:

'Wait 1
Cls
Lcd "test"
Lowerline
Lcd "12345678"

'Wait 10
'Goto Main

End

Though I am not an expert either in in BASCOM or in ATmega, I fear at every character sent to LCD , perhaps a delay routine has to follow. please check the conventions

Is you statement $crystal =100000 correct? Are you using 1MHz?

Sarma

Those LCD displays are very slow.

Leon

try this site, he uses bascom and 44780 lcds there might be something there.

http://www.avrprojects.net/articles.php?lng=en&pg=61

Chris