Dropped Character on GLK12232-25-SM
Posted: Mon Oct 27, 2008 1:59 pm
I am using a PIC18F4550 to communicate via RS232 to the LCD. I am using a software UART library that came with the Microchip C18 compiler. In response to an encoder I update the text on the LCD. Here is the function I have written to write text to the display:
void DisplayWriteRAMText(char *Text, unsigned char x, unsigned char y,
unsigned char font){
//Set Font
WriteUART(DISP_START_CMD);
WriteUART(DISP_SET_FONT);
WriteUART(font);
//Set Cursor position
WriteUART(DISP_START_CMD);
WriteUART(DISP_SET_CURSOR);
WriteUART(x);
WriteUART(y);
//Send Text
while (!(*Text == \0)){
WriteUART(*Text);
Text++;
}
}
The display is seemingly randomly dropping the leading character. I have single stepped through the code and have found that the pointer is being passed correctly and the text is correct. Any suggestions would be appreciated.
void DisplayWriteRAMText(char *Text, unsigned char x, unsigned char y,
unsigned char font){
//Set Font
WriteUART(DISP_START_CMD);
WriteUART(DISP_SET_FONT);
WriteUART(font);
//Set Cursor position
WriteUART(DISP_START_CMD);
WriteUART(DISP_SET_CURSOR);
WriteUART(x);
WriteUART(y);
//Send Text
while (!(*Text == \0)){
WriteUART(*Text);
Text++;
}
}
The display is seemingly randomly dropping the leading character. I have single stepped through the code and have found that the pointer is being passed correctly and the text is correct. Any suggestions would be appreciated.