PDA

View Full Version : A question for all those who have played with LCD displays



Navaidstech
- 30th May 2010, 02:50
I came across this problem in the past when programming LCD displays with 6800 and HC11 series
processors and now with the F628 chip.
I'm currently developing a program that uses a 4x20 display to display incoming data. The display
will refresh with the rate of the incoming data and could even be as often as 50 milliseconds.
The problem that I'm having is that quite often, especially when the refresh rate is high, either
some characters will be garbled or the formatting is totally gone - ie. if I want to display something
at the beginning of line 4, it will start displaying in the middle of line 3.
To me it seems like there is some sort of a timing issue or the LCD is unable to cope with high
refresh rates.
I'm just curious if anyone else has encountered this problem in the past and what measures did
you take to circumvent this problem.
BTW, I'm using a 4 wire interface to push data to the LCD.
Thanks!

mackrackit
- 30th May 2010, 04:08
I normally
PAUSE 150
after updating a display.

But that sounds like a problem for your app.
Does all four line need updated that often? maybe a 7 seg LED bank for the fast updates?

Navaidstech
- 2nd June 2010, 17:09
I normally
PAUSE 150
after updating a display.

But that sounds like a problem for your app.
Does all four line need updated that often? maybe a 7 seg LED bank for the fast updates?

Yes, it will definitely be a problem unless I come up with a better way of updating the display. Right now, it displays "live data" as it happens and depending on the events, the refresh rate could even be as often as 50 ms.
So, with 150 ms pause, you see no issues with formatting, weird characters, etc?

mackrackit
- 2nd June 2010, 17:35
No problems with the PAUSE 150.

Post you LCD setup and a snippet where the problem happens. We might see a better work around?

falingtrea
- 7th June 2010, 16:05
Isn't there a "Ready" or "Busy" bit sent by the display that you can read to determine when the display is ready to accept more data? I think it is one of the bits returned when you do a read in instruction mode.

Navaidstech
- 8th June 2010, 03:19
Sorry guys, got sidetracked here....

OK, here is the snippet of the code. This is essentially a display routine, which will fire up everytime one of the SPEEDUNITS varaiables changes. This could be as often as 20 ms.
However, I have also noticed this problem with slower update speeds (ie. 1 second).
I'm driving a 4x20 display using 4 data lines.


DisplayResults:
lcdout $fe,1,$fe,2 ' Clear Display
lcdout $fe,$80,#Speedunits[0], " FPS" ' Display pulse value
lcdout $fe,$89,#Speedunits[1], " FPS" ' Display pulse value
lcdout $fe,$C0,#Speedunits[2], " FPS" ' Display pulse value
lcdout $fe,$C9,#Speedunits[3], " FPS" ' Display pulse value
lcdout $fe,$94,"Top Speed ",#PeakSpeed," FPS"

return

mackrackit
- 8th June 2010, 15:27
lcdout $fe,$94,"Top Speed ",#PeakSpeed," FPS"
You are using 14 spaces in the above with text, then what ever the VAR is using. Add that to the four blank spaces, $94, you might be running out of spaces?
You might try

lcdout $fe,$90,"Top Speed ",#PeakSpeed," FPS"

Navaidstech
- 11th June 2010, 01:43
lcdout $fe,$94,"Top Speed ",#PeakSpeed," FPS"
You are using 14 spaces in the above with text, then what ever the VAR is using. Add that to the four blank spaces, $94, you might be running out of spaces?
You might try

lcdout $fe,$90,"Top Speed ",#PeakSpeed," FPS"

Actually no... with the address $94, the text starts right at the beginning of the line.

mackrackit
- 11th June 2010, 03:34
Well, I am out of ideas. Do you have a data sheet for the display? Might shed some light.

Acetronics2
- 11th June 2010, 12:46
Sorry guys, got sidetracked here....

OK, here is the snippet of the code. This is essentially a display routine, which will fire up everytime one of the SPEEDUNITS varaiables changes. This could be as often as 20 ms.
However, I have also noticed this problem with slower update speeds (ie. 1 second).
I'm driving a 4x20 display using 4 data lines.


DisplayResults:
lcdout $fe,1,$fe,2 ' Clear Display
lcdout $fe,$80,#Speedunits[0], " FPS" ' Display pulse value
lcdout $fe,$89,#Speedunits[1], " FPS" ' Display pulse value
lcdout $fe,$C0,#Speedunits[2], " FPS" ' Display pulse value
lcdout $fe,$C9,#Speedunits[3], " FPS" ' Display pulse value
lcdout $fe,$94,"Top Speed ",#PeakSpeed," FPS"

return

Hi, Just try to place your " LCDOUT $FE,1 " command OUTSIDE your loop ... ( really needed once only in a program !!! @ top lines i.e. )

so your sub comes to:


DisplayResults:

lcdout $fe,$80,#Speedunits[0], " FPS" ' Display pulse value
lcdout $fe,$89,#Speedunits[1], " FPS" ' Display pulse value
lcdout $fe,$C0,#Speedunits[2], " FPS" ' Display pulse value
lcdout $fe,$C9,#Speedunits[3], " FPS" ' Display pulse value
lcdout $fe,$94,"Top Speed ",#PeakSpeed," FPS"

return

Will handle the 50 Hz refreshment, now ...
and note " Home " command already included in the " lcdout $fe,1 " and " lcdout $fe,$80 " commands ...

Alain

Navaidstech
- 29th June 2010, 20:58
Hi guys... sorry for the delay.
I've done some extensive testing on the LCD displays and Acetronics is right! I'm using a single reset at the top of the program now and clear the screen thereafter.
Works like a charm now, no funny characters and everything falls in place perfectly.
Thanks to all of you guys for your input and Acetronics for nailing it.