NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Problem setting LCD cursor

November 16, 2011
by jhagmar
jhagmar's Avatar

I have a problem with initialload not being able to set the cursor correctly. After I assembled my NerdKits, the preloaded congratulations message displayed correctly with text on all four lines of the LCD. When flashing initialload however, text is only displayed on the first line, and it seems that the lcd_line_xxx functions from lcd.h all set the cursor to one character before the top left cursor position. To help diagnose the problem, I changed the text setting part of initialload to:

lcd_line_one();
lcd_write_string(PSTR("0123456789abcdefghij"));
lcd_line_two();
lcd_write_string(PSTR("klmnopqrstuvwxyzABCD"));

which results in the screen displaying "lmnopqrstuvwxyzABCD " (sic!) on the first line, and nothing on the other lines of the LCD. What could be the problem here?

/Jonas

November 16, 2011
by Ralphxyz
Ralphxyz's Avatar

Loose wire? Amazing how finicky the breadboards and wiring is when you first start, it seems to get better with time.

Ralph

November 16, 2011
by jhagmar
jhagmar's Avatar

Hi Ralph,

Thanks, I'll start by rewiring the LCD and if that doesn't work, I'll verify the connections with a multimeter. I do think that the fact that the preloaded program worked flawlessly speaks against the loose wire theory, unless some wire got disconnected at the precise moment when the new program was flashed. I also find it strange that the correct letters are displayed if a wire is loose, since the characters are transmitted to the LCD using the same write function as the cursor commands.

Jonas

Post a Reply

Please log in to post a reply.

Did you know that Morse code is a compact way to transmit human-readable text over binary channels? Learn more...