Serial LCD's


Closed Thread
Results 1 to 10 of 10

Thread: Serial LCD's

  1. #1
    EShatara's Avatar
    EShatara Guest

    Default Serial LCD's

    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

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    did you try to add
    DEFINE CHAR_PACING 1000

    at the program header to see what's happening
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    EShatara's Avatar
    EShatara Guest


    Did you find this post helpful? Yes | No

    Default Pacing

    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

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    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
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5
    EShatara's Avatar
    EShatara Guest


    Did you find this post helpful? Yes | No

    Smile Did the trick

    That seemed to do the trick. I did however have to put in a 100ms pause between the clears.

    Thanks...chris

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    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?!?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Post

    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

  8. #8
    EShatara's Avatar
    EShatara Guest


    Did you find this post helpful? Yes | No

    Default Will Give it a try

    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

  9. #9
    EShatara's Avatar
    EShatara Guest


    Did you find this post helpful? Yes | No

    Default Resister worked

    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

  10. #10
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Smile

    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

Similar Threads

  1. Replies: 33
    Last Post: - 19th March 2010, 03:02
  2. Dynamic USB Serial Number (PIC18F4550)
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 16th July 2009, 17:03
  3. PIC18F4680 to PC via MAX232 (RS232 serial) no output
    By opticsteam1 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 14th April 2008, 20:39
  4. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  5. Replies: 2
    Last Post: - 23rd July 2006, 08:16

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts