Buffer overflow or maximum turnaround time to receive char

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

Moderators: Henry, Mods

Post Reply
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Buffer overflow or maximum turnaround time to receive char

Post by shasson »

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
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

Unfortunately this is a limitation of the display...We use an internal buffer that controls 96 bytes of information...For the time being this will your maximum performance... :)
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Flow control or buffer fullness indicator for I2C and RS-232

Post by shasson »

Hi,

I just wanted to confirm that there is no way to know how full the buffer is in both RS-232 and I2C modes, correct?

Thanks.

Scott
Miles
Matrix Orbital
Matrix Orbital
Posts: 1105
Joined: Mon Mar 04, 2002 4:00 pm

Post by Miles »

The only way to know how full or empty the buffer is at any given time would be if you incorporated flow control mode. :)
Miles Y.
Head of Technical Support
Product Manager
Matrix Orbital
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

Flow control mode / buffer

Post by shasson »

However, the flow control mode is unavailable when using I2C.

I was wondering if anyone knew about how long it takes for the LCD to handle one byte in it's buffer? Or is that dependent on the type of instruction being sent?
Tom
Matrix Orbital
Matrix Orbital
Posts: 1030
Joined: Mon Jul 19, 2004 4:43 pm
Location: Calgary
Contact:

Post by Tom »

The time it takes to handle one byte is quite variable depending on if
it is a command or character, and what command it is. Characters should
be fairly constant however, so you should be able to estimate the delay
required between characters.

In your code you use a for loop to create the delay. Depending on the
compiler this can cause some inconsistency when the compiler optimizes
the code. If you have a real time clock available to you try using a
timed delay, the results will be far more consistent.
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

time for LCD to respond with a buffer full byte

Post by shasson »

Hi,

When the LCD is in flow control mode and it realizes that it's buffer is full, how long does it take it before it sends out the buffer is full byte?

I have done some of my own experimentation and it appears to take about 50ms from when the LCD has received enough bytes to make it full to when I receive the byte stating that it's buffer is full. Is that a correct statement? Just wondered if anyone else had seen this to be true.

Thanks.
Tom
Matrix Orbital
Matrix Orbital
Posts: 1030
Joined: Mon Jul 19, 2004 4:43 pm
Location: Calgary
Contact:

Post by Tom »

Hi Shasson,

50ms sounds low.

What size of font are you using?
shasson
LCD Geek
Posts: 28
Joined: Mon Dec 22, 2003 7:07 am

size of font being used

Post by shasson »

Hi,

I am using a 5x7 font (the small font provided).

Thanks.
Post Reply