Buffer overflow or maximum turnaround time to receive char
Posted: Wed Jun 30, 2004 1:46 pm
Hi,
I have noticed that the LCD I am working with ( GLK12232-25-SM ) can only be updated with new characters only so fast or it will error, showing the wrong character, on the wrong line or possibly even interpret the characters I've sent as a command (sometimes changing the baud rate, requiring a boot with the jumper set to reset the baud rate). I was wondering if there is a known frequency that the LCD can handle characters being sent to it? Is there a buffer? What is the length?
Here is the code I have been using to test the required delay between sending characters to the LCD. I have found that the NUMBER_OF_LOOPS needs to be set to approximately 1500000 to ensure that no errors will occur. This loop delay is still less than Sleep(1) though.
char TestChar[60] = "ABCDEFGHIJKLMNOPQRST01234567890123456789ZYXWVUTSRQPONMLKJIHG";
for(int z=0; z<500;z++)
{
SerialPort.Write(TestChar[z%60]);
long i,j,k;
k=5;
for (i=0; i<NUMBER_OF_LOOPS; i++)
j = k*i;
}
There is no huge issue with me using this delay, I just wondered if there was anyway to speed it up. I find it noticably slows down the test when appearing on the LCD.
Thanks.
Scott
I have noticed that the LCD I am working with ( GLK12232-25-SM ) can only be updated with new characters only so fast or it will error, showing the wrong character, on the wrong line or possibly even interpret the characters I've sent as a command (sometimes changing the baud rate, requiring a boot with the jumper set to reset the baud rate). I was wondering if there is a known frequency that the LCD can handle characters being sent to it? Is there a buffer? What is the length?
Here is the code I have been using to test the required delay between sending characters to the LCD. I have found that the NUMBER_OF_LOOPS needs to be set to approximately 1500000 to ensure that no errors will occur. This loop delay is still less than Sleep(1) though.
char TestChar[60] = "ABCDEFGHIJKLMNOPQRST01234567890123456789ZYXWVUTSRQPONMLKJIHG";
for(int z=0; z<500;z++)
{
SerialPort.Write(TestChar[z%60]);
long i,j,k;
k=5;
for (i=0; i<NUMBER_OF_LOOPS; i++)
j = k*i;
}
There is no huge issue with me using this delay, I just wondered if there was anyway to speed it up. I find it noticably slows down the test when appearing on the LCD.
Thanks.
Scott