Problems with LCD display


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    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 --------------------------------------------

  2. #2
    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

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


    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 : 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