Problems with LCD display


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579

    Default Problems with LCD display

    I recently bought some LCD's ; all are made in PRC, and "full compatible with HD44780 standard".
    I try to use with an "old" schematic (with an "old" display (model -PRC 1602 A) this schematic work without any problem !).
    But ... with original code (with only this : "LCDOUT $FE, 1, $FE, $0C" line ), none of them is initialized correctly on first "start" !
    I put one picture with ...stranges characters that appear on the display (to all of them !).
    After modification of program, they go right ... in 7 cases of 10 (I mean when I power on the schematic ...).
    Code:
    DEFINE LCD_DREG PORTC           ' LCD on port c
    DEFINE LCD_DBIT 0               ' Data bits C0..C3
    DEFINE LCD_RSREG PORTA          ' RS on PORTA
    DEFINE LCD_RSBIT 1              ' RS on A1 
    DEFINE LCD_EREG PORTA           ' E on PORTA
    DEFINE LCD_EBIT 2               ' E on A2
    DEFINE LCD_BITS 4               ' LCD 4 bit mode
    DEFINE LCD_LINES 2              ' 2 line LCD display
    Define LCD_COMMANDUS 2000       ' Command Delay (uS)
    Define LCD_DATAUS 50            ' Data Delay (uS)
    
    
    LCDOUT $FE,1:PAUSE 3000:LCDOUT $FE,1         ' Initialize LCD WITH HUGE PAUSE !!!
    Pause 3000                    ' AND AGAIN ... 
    LcdOut $FE, $80," DUAL TERMOMETER "
    LcdOut $FE, $C0,"  AND THERMOSTAT "
    PAUSE 5000                    ' AND AGAIN ...
    LCDOUT $FE, 1, $FE, $0C                 ' Clear display, cursor off
    Pause 1000
    What can I do in this case ? Thanks in advance for any suggestion !
    Attached Images Attached Images   

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    Try increasing the LCD_COMMANDUS and LCD_DATAUS. Double or tripple them, if it OK then work your way down to the lowest values that works. Alternatively look in the datasheet for the specified delay needed.

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    I already try this, BEFORE increasing Pause ... I discovered the "scroll" code dont work fine too...I think these displays are "stinky" !

  4. #4
    Join Date
    Oct 2011
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    I have had this problem with some cheap displays, they are slow to start up.
    Try a pause before initializing

    PAUSE 1000
    LCDOUT $FE,1

    Phil

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


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    Hi Fratello,
    I found it helps to add bypass capacitors on the power inputs of these too.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    Thanks !
    I found this great piece of code (Thanks to Mr.Darell !!!) ; ALL my LCD's work fine now !!!
    Code:
    GOSUB LCD_INIT                            ' Do manual LCD Initialization
    
    ;---- Manual LCD Initialization -------------------------------------
    LCD_INIT:
        @ MOVE?CT  0, LCD_RSREG,LCD_RSBIT     ; Start with RS LOW
        @ MOVE?CT  0, LCD_RSREG+80h,LCD_RSBIT ; RS is OUTPUT
        
        @ MOVE?CT  0, LCD_EREG,LCD_EBIT       ; Start with Enable LOW
        @ MOVE?CT  0, LCD_EREG+80h,LCD_EBIT   ; Enable is OUTPUT
    
        @ MOVE?CT  0, LCD_DREG+80h,LCD_DBIT   ; Data Bus is OUTPUT
        @ MOVE?CT  0, LCD_DREG+80h,LCD_DBIT +1
        @ MOVE?CT  0, LCD_DREG+80h,LCD_DBIT +2
        @ MOVE?CT  0, LCD_DREG+80h,LCD_DBIT +3
        
        PAUSE 1000
        BUSdata = 3
        GOSUB Send4Bit : pause 8              ; FunctionSet 4 times
        GOSUB Send4Bit : pauseUS 200
        GOSUB Send4Bit : pauseUS 200
        GOSUB Send4Bit : pauseUS 200
        BUSdata = 2  :  GOSUB Send4Bit        ; 4-bit mode
    
        BUSdata = 2  :  GOSUB Send4Bit        ; 2-line, 5x7
        BUSdata = 8  :  GOSUB Send4Bit        
        
        BUSdata = 0  :  GOSUB Send4Bit        ; Display OFF
        BUSdata = 8  :  GOSUB Send4Bit
        
        BUSdata = 0  :  GOSUB Send4Bit        ; Display Clear
        BUSdata = 1  :  GOSUB Send4Bit
        PAUSE 3
    
        BUSdata = 0  :  GOSUB Send4Bit        ; Entry Mode Set
        BUSdata = 6  :  GOSUB Send4Bit
        PAUSE 3
        
        BUSdata = 0  :  GOSUB Send4Bit        ; Display ON
        BUSdata = $C :  GOSUB Send4Bit
        
        @  MOVE?CT 1, LCDINITFLAG   ; Tell PBP LCD is already Initialized
    return
    
    
    Send4Bit:
        @ MOVE?CT  1, LCD_EREG,LCD_EBIT       ; Enable LCD
    @   MOVE?BB  LCD_DREG, _TempB             ; Put Data on the Bus R-M-W
    @   if LCD_DBIT == 0                      ;   Bus starts at 0
            TEMPB = (TEMPB & $F0) | BUSdata
    @   else                                  ;   Bus starts at 4
            TEMPB = (TEMPB & $0F) | (BUSdata << 4)
    @   endif
    @   MOVE?BB  _TempB, LCD_DREG  
        
        PAUSEUS 25                            ; Keep enabled extra long
        @ MOVE?CT  0, LCD_EREG,LCD_EBIT       ; Disable LCD
        Pauseus 50
    return
    ;---------- END LCD_INIT --------------------------------------------

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    That's awesome!

    It didn't work for the guy I wrote it for 6 years ago.
    I'm glad to see it fixed your problem!

    Thanks fratello.
    DT

  8. #8
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    579


    Did you find this post helpful? Yes | No

    Default Re: Problems with LCD display

    I THANK YOU ! Glad to be member of this forum, where I "met" so special people ... Best regards !

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