MOVE CURSOR BACK causes linefeed after 20 uses

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
ktrussell
LCD?
Posts: 2
Joined: Sat Jul 19, 2008 1:42 pm

MOVE CURSOR BACK causes linefeed after 20 uses

Post by ktrussell »

I have an LK202-25 2X20 display, version 5.7. I am using the serial port connected to a PIC board I designed. If the display is cleared first, the following code should display a character in the upper left corner, move back and overwrite it, repeatedy from A-Z. After the 20th character, however, the display moves to the next line as if I had reached the end of the current line. After the next 20 characters, it scrolls the display up, etc. The position should still be at the beginning because of the "move cursor back" command after each character. It seems that the display doesn't decrement its character position when the "move cursor back" command is given. Can any one explain?

char c;
while(1) {
for(c='A';c<='Z';c++) {
DelayMs(200); /* Delay 200 milliseconds to see what is happening */
lcd_write(c); /* this is a function that sends a char out serial port */
lcd_write(0xFE); /* Send the MOVE CURSOR BACK command */
lcd_write('L');
}
}
Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Ktrussell,

Unfortunately, there is a known bug in all the alphanumeric units regarding the move cursor back command, and it's control character equivalent. We expect to make a product wide switch in the future once code space becomes available, however, at this time, you'll have to work around it.

I tried out your algorithm using the return home command, 'H', which moved the cursor to the top left without any scrolling problems. I suspect the extended move cursor command, with a position specified, will similarly help you avoid the scrolling issue.

Again, I apologize for the inconvenience, and will be happy to answer any further questions you may have regarding this issue.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital
ktrussell
LCD?
Posts: 2
Joined: Sat Jul 19, 2008 1:42 pm

Post by ktrussell »

Thanks Troy for the quick reply. That means a lot. I have worked around the problem by keeping up with the location myself and using the "goto" command to move back rather than the move back command. The module works great otherwise and the keypad interface is a great touch.
Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hi Ktrussel,

No worries, great to hear that you've been able to get that LK202-25 working well for you. If you run into any other questions or concerns, just ask.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital
Post Reply