View Full Version : Serial LCD's
EShatara
- 29th November 2004, 02:30
I'm have inconsistant results when using a Serial LCD as a debug/development tool to tell me what's happening in my program.
I've homed in on:
+ Pausing for 1 second on powerup to all the LCD to stabalize
+ I pause for 0.5 seconds after a clear
+ If I direct the cursor to the home position (line1 or line2) I'll pause for
10ms or so to make sure the command is executed.
+I tried running at 2400 baud and have changed over to 1200 baud.
One frequent quirk is that I usually get a bogus character at the home postion
after powering up, clearing and sending the first "Message".
Seems I'm spending more time debugging the LCD display rather my code. :-(
Thanks for any experience you can share...Chris
mister_e
- 29th November 2004, 04:19
did you try to add
DEFINE CHAR_PACING 1000
at the program header to see what's happening
EShatara
- 29th November 2004, 17:04
Thanks Steve,
I've tried pacing after I posted my question. It has made a difference but I still get a garbled character on the very first access to the LCD. The code currently is:
DEFINE CHAR_PACING 500
..
Pause 1000
Serout 3,N1200,[254.1]
Pause 500
Serout 3,N1200,[254,20]
Pause 20
Serout 3,N1200,["Waiting For Cmd"]
Serout 3,N1200,[254,192,"Address = ",#UnitAddr]
The VERY FIRST time this code is executed, I will get a garbled character in front of the message "Waiting for Cmd". Can't for the life of me figure out what's causing it.
Not a big deal for what I'm doing but I would like to understand what is happening here.
Thanks..chris
Dwayne
- 29th November 2004, 18:19
Hello Chris,
Chris>>The VERY FIRST time this code is executed, I will get a garbled character in front of the message "Waiting for Cmd". Can't for the life of me figure out what's causing it.<<
Try sending two "Clear" statements in a row.
First guess is, the senquencing of the Serial data between the two systems. Bad grounds will cause this.
Dwayne
EShatara
- 29th November 2004, 18:56
That seemed to do the trick. I did however have to put in a 100ms pause between the clears.
Thanks...chris
mister_e
- 30th November 2004, 09:10
Pause 1000
Serout 3,N1200,[254.1]
Pause 500
Serout 3,N1200,[254,20]
hope this is not an error from you guy 254.1 or 254,1?
can you try
SEROUT 3,N1200[254,1,254,20,"first message",13,10]
what about now?!?
Ingvar
- 30th November 2004, 11:44
Hi Chris,
My guess is that your seroutpin is floating up to the point when you send the first character, this character will for this reason be garbled. You could either put a "LOW 3" before the first pause(1000), or you could add a pulldown resistor to the serial datapin. 10k would probably be enough.
/Ingvar
EShatara
- 30th November 2004, 14:48
I'll give this a try a little later on this morning. I have a scope so I'll attempt to see what's happening.
Thanks for the tip..
Chris
EShatara
- 1st December 2004, 21:17
Hi Ingvar,
The resistor did the trick. I really didn't see a difference in the signal quality using a scope but the display has been quite stable for the past day.
thanks for the suggestion.
/chris
Ingvar
- 2nd December 2004, 07:56
Good to hear that it works.
Perhaps you couldn't see any difference because your scope acted like a pulldown. Some cheaper scopes have less than one mega ohm on their input.
/Ingvar
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.