Place cursor and clear screen using RS-232
Posted: Mon Nov 08, 2010 10:27 am
I am using the PIC 16F877A to control the GLC24064 V2.0 and I am able to write to the LCD with the following program but the command to clear the screen and place the cursor does not work. The program is below and produces the following on the LCD;
feXfeHABCDEFGHIJKLMNOPQRSTUVWXYZ
and will wrap itself if placed again and again until the display scrolls upward.
Any assistance provided would be greatly appreciated.
#include <16F877A.h>
#device ICD=TRUE
#use delay (clock=10000000)
#use rs232(baud=19200, xmit=PIN_C6, rcv = PIN_C7)
void main() {
int j;
delay_ms(500);
printf("%xX",0xFE); // Clear screen
printf("%xH",0xFE); // Home position
for(j='A'; j<='Z'; j++)
{printf("%c",j);}
while(1);
}
feXfeHABCDEFGHIJKLMNOPQRSTUVWXYZ
and will wrap itself if placed again and again until the display scrolls upward.
Any assistance provided would be greatly appreciated.
#include <16F877A.h>
#device ICD=TRUE
#use delay (clock=10000000)
#use rs232(baud=19200, xmit=PIN_C6, rcv = PIN_C7)
void main() {
int j;
delay_ms(500);
printf("%xX",0xFE); // Clear screen
printf("%xH",0xFE); // Home position
for(j='A'; j<='Z'; j++)
{printf("%c",j);}
while(1);
}