LCD misspells and drops Charactors


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default LCD misspells and drops Charactors

    Hello Esteemed Forum Members,
    Posted below is part of the code I am using to make an LCD serial backpack display and while it works, it drops charactors and misspells words in the string.
    I am hoping for a better explanation of what each define actually does than the manual gives, as the manual is clearly written for engineers who already know these things. Thank You ,
    JS
    include "modedefs.bas"
    ' Define LCD registers and bits<h4> I got these first 7</h4>
    Define LCD_DREG PORTB
    Define LCD_DBIT 4
    Define LCD_RSREG PORTA
    Define LCD_RSBIT 0
    Define LCD_EREG PORTA
    Define LCD_EBIT 1

    DEFINE LCD_LINES 4 'Define using a 4 line LCD
    <h4>DEFINE LCD_COMMANDUS 2000 'Define delay time between sending LCD commands
    DEFINE LCD_DATAUS 50 'Define delay time between data sent.
    </h4>DEFINE OSC 20
    I believe the problem is there as a VFD I have tried does not do this.
    JS

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


    Did you find this post helpful? Yes | No

    Default

    Try a slower baudrate first... 300bauds

    I you're using an internal OSC... it may work only at slow baudrate.

    Serious serial comm=serious osc (Crystal OR ceramic resonator... i stick to crystal)
    Steve

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

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Cool I think I got it

    Mister_e,
    Slowing the baud rate didn't do it, I tried in my mind to justify why this error occured with a 4 line LCD but not a 2 line VFD,so I tried a different LCD and still got the same errors. I started with the hypothesis, maybe the LCD was using more power than the VFD, causing the pic to brown out, I tried a 1000uF capacitor on the pic VDD (power in) pin and that didn't help. I moved it to the LCD terminal 3 (the contrast line) and viola it stopped making the errors, however it required the LCD to be initialised and then a PIC reset to work. I replaced the 1000uF cap with a .1uF bypass capacitor and all is as it should be.
    Fat Dumb and Happy again!
    JS

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


    Did you find this post helpful? Yes | No

    Default

    Good!

    The reset stuff is normal, FYI you could also insert the following line
    Code:
    FLAGS=0
    and at the next LCDOUT it will send all needed initialisation stuff to your LCD... but i think it's not a too good idea as you could maybe miss some character.

    Anyway... who suggest to swap LCD when the power is on? Not me for sure
    Steve

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

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Joe S., How long is the cable from the LCD to the PIC? Do you have a scope? If so put the leads on the power lines from the +5v and the ground at the display and see if you can see any noise in the region of 100mv or so. If this is the case I would power the LCD with separate leads from the LCD to the +5volt source. Depending on the length of the cable you are using, if it is too long the data lines are seeing cross coupling and this is being interpreted as bad data. The maximum length of the cable should not exceed more then about 6 inches. i have had problems in the past with VFD displays that draw much more power. An LCD display shouldn't draw more then a couple of milliamps without the backlighting. Are you running the backlighting from the same cable as the LCD data cable? If so I would change it to seprate cables and run it directly to the output of the supply.

    Dave Purola,
    N8NTA

Members who have read this thread : 0

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