Has anyone ever connected a 2x40 LCD display?

I've not been using an arduino long but I'm trying to hook up a 2x40 LCD display. Its an LM092LN LCD module that I picked up off ebay a while ago and had hooked up to my parallel port. I think everything is wired properly, as I can get text to appear on the display initially but as the sketch progresses with the examples given the display is filled with garbage rather than what I want. I've tried almost all of the 4bit LCD libraries which work to some degree after I edit them to set the correct pins. The module uses the standard Hitachi HD44780 controller, but I think the problem lies in that the libraries assume that the display is only 20 characters long as most examples seem to use either a 2x16 or a 4x20 display. I also have two DS18B20 temp sensors to hook up as I plan to use this to monitor my room and fish tank temps. Any help would be much appreciated.

I've been playing with LCD displays on my Diecimila board, and can maybe offer a couple of things.

The couple of 40-char displays that I've tried exhibited some of what you've described. When I dug into the specs and code, I found what was causing it. A lot of the sample code assumes a 16-char display, and simply 'rolls over' to the next line; the specs on the displays I was using indicated that there was a 'dead zone' between the end of one line, and the memory location that started the next.

The way it looks to me, a 16x2 display simply uses a single byte to address all the positions (low nybble for position, high nybble for line) -- something that won't work on longer display lines. What I ended up having to do was decide between simply sending a bunch of null characters to wrap to the next line, or specifically telling the LCD when to write to it. Either way, I had to keep track of what I'd written and where. :(

Hope this helps... /me