LCD going crazy!!!


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Posts
    747

    Default LCD going crazy!!!

    This is a test program for my LCD. Sometime I can read on the screen but the following second the words are jumping from one line to another and the letters and just going about anywhere... any thoughts

    Code:
    'LCD testing program
    
    INCLUDE "modedefs.bas"
    OSCCON = %01110000 '8 Mhz
    
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    '/////////////////////////
    '// LCD configuration //
    '/////////////////////////
    
    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
    DEFINE LCD_RSBIT 2 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTA ' Set LCD Enable port
    DEFINE LCD_EBIT 3 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 2000
    pause 1000
    
    
    Mainloop:
    
            lcdout $FE,1, " This is a test"                    '
            lcdout $FE,$C0, "Next or Select"                 '
            pause 200
                
    GOTO Mainloop
    End

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    Just thinking aloud. Have you tried telling PBP
    define OSC 8
    so that it knows you are working at 8MHz and can adjust its timings accordingly.

  3. #3
    bjsunbeam's Avatar
    bjsunbeam Guest


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    try a pause between each lcd out
    Some of the cheaper LCD's are not good with fast transfers
    You can also try adjusting the LCD commandUs etc

  4. #4
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    I did try using define, same thing happens. I have been using this LCD for a couple of years now. This is happening since I upgraded to windows7 64 bit. and using microcode studio

    K

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    I also changed pic, used different pins for RS RE LCDout. I just have not changed the LCD module with a new one.. maybe its the LCD ...

  6. #6
    Join Date
    Nov 2007
    Location
    West Covina, CA
    Posts
    219


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    How about:
    Code:
    Mainloop:
    
            LCDOUT $FE,1    ' Clear display
            PAUSE 50 
            LCDOUT $FE,2," This is a test"       ' Move to 1st line, writes 15 CHAR
            LCDOUT $FE,$C0,"Next or Select"     ' Move to 2nd line, writes 14 CHAR
            PAUSE 200
                
    GOTO Mainloop
    End
    Louie

  7. #7
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    966


    Did you find this post helpful? Yes | No

    Default Re: LCD going crazy!!!

    taking a cue from Louie, I'd say, you're writing too fast for the lcd to keep pace.

    You can try this
    Code:
    Mainloop:          
                     LCDOUT $FE,1    ' Clear display         
                     LCDOUT $FE,2," This is a test"       ' Move to 1st line, writes 15 CHAR         
                     LCDOUT $FE,$C0,"Next or Select"     ' Move to 2nd line, writes 14 CHAR 
    STOP 
    End

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