LCD wont work :(


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    How are the pin 3 (Contrast adjustment) connected?

    Have you tried to change the LCD defines?

    Code:
    ‘ Set command delay time in us
    DEFINE LCD_COMMANDUS 1500
    ‘ Set data delay time in us
    DEFINE LCD_DATAUS 44

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The 628A has comparators on portA. Not sure about the 628. If it does look at this.
    http://www.picbasic.co.uk/forum/showthread.php?t=561
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    hoi,

    this works with 628 and Sharp LM16A211 at 4Mhz
    2 rows of black squares if disp is not initialised ( at power up)
    init the display first at startup

    rgds
    tb

    pause 2000

    DEFINE LCD_DREG PORTD 'dataport select'
    DEFINE LCD_DBIT 0 'first databit
    DEFINE LCD_RSREG PORTA 'lcd register port
    DEFINE LCD_RSBIT 3 'register select bit'
    DEFINE LCD_EREG PORTA 'enable poort'
    DEFINE LCD_EBIT 1 'enable bit'
    DEFINE LCD_BITS 4 'lcd bus size'
    DEFINE LCD_LINES 2 'lcd lines'
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50 'data delay in µs'

    'init display
    LCDOUT $FE,1 ' clear LCD
    pause 100 ' pauze 0,1s
    LCDOUT $FE,2 ' cursor home
    LCDOUT $FE,$0C ' cursor off
    pause 1000 ' pauze 0,1s


    ' message

    LCDOUT $FE, $80, " hello "
    LCDOUT $FE, $C0, " ready "
    pause 1000 ' pauze 0,1s

    go on

  4. #4
    Join Date
    Aug 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tiger_bel View Post
    hoi,

    this works with 628 and Sharp LM16A211 at 4Mhz
    2 rows of black squares if disp is not initialised ( at power up)
    init the display first at startup

    rgds
    tb

    pause 2000

    DEFINE LCD_DREG PORTD 'dataport select'
    DEFINE LCD_DBIT 0 'first databit
    DEFINE LCD_RSREG PORTA 'lcd register port
    DEFINE LCD_RSBIT 3 'register select bit'
    DEFINE LCD_EREG PORTA 'enable poort'
    DEFINE LCD_EBIT 1 'enable bit'
    DEFINE LCD_BITS 4 'lcd bus size'
    DEFINE LCD_LINES 2 'lcd lines'
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50 'data delay in µs'

    'init display
    LCDOUT $FE,1 ' clear LCD
    pause 100 ' pauze 0,1s
    LCDOUT $FE,2 ' cursor home
    LCDOUT $FE,$0C ' cursor off
    pause 1000 ' pauze 0,1s


    ' message

    LCDOUT $FE, $80, " hello "
    LCDOUT $FE, $C0, " ready "
    pause 1000 ' pauze 0,1s

    go on

    I have try that code, and I cant get it work.
    I have try to switch to a new LCD display, and still same problem.
    Now i have try with PIC16F676, almost the same problem there, but this time the first row is showing black squares on initializing and then clear screen 1 sec later...

    Here is the code for pic16f676:

    @ device INTRC_OSC_NOCLKOUT
    DEFINE LCD_DREG PORTC 'dataport select'
    DEFINE LCD_DBIT 0 'first databit
    DEFINE LCD_RSREG PORTC 'lcd register port
    DEFINE LCD_RSBIT 4 'register select bit'
    DEFINE LCD_EREG PORTC 'enable poort'
    DEFINE LCD_EBIT 5 'enable bit'
    DEFINE LCD_BITS 4 'lcd bus size'
    DEFINE LCD_LINES 2 'lcd lines'
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50 'data delay in µs'

    CMCON = 7
    VRCON = 0

    Pause 1000
    'init display
    LCDOut $FE,1 ' clear LCD
    Pause 100 ' pauze 0,1s
    flags = 0
    LCDOut $FE,2 ' cursor home
    LCDOut $FE,$0C ' cursor off
    Pause 1000 ' pauze 0,1s


    ' message

    LCDOut $FE, $80, " hello "
    LCDOut $FE, $C0, " ready "
    Pause 1000 ' pauze 0,1s


    loopme:
    Pause 1000
    High PORTA.0
    Pause 1000
    Low PORTA.0
    GoTo loopme

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    The 676 has ADC on port C. Might help to turn that off.
    How do you have the LCD contrast pin connected?
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    you are using 4bit datatransfer to display.
    are the 4 bits connected to DB4 to DB7 on display side ???

    rgds
    tiger_bel

  7. #7
    Join Date
    Aug 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    Wiring diagram:


    This is how the LCD display looks like for about 1sek before the screen goes blank again..


    Thanks for all help so far

Similar Threads

  1. first project, and yes, doesn`t work
    By bogdan in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 28th April 2009, 06:13
  2. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  3. cant get my Lcd to work using Pic18f452
    By civicgundam in forum General
    Replies: 13
    Last Post: - 7th October 2007, 00:13
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. Why doesn't my code for 18f452 work on 18f252?
    By senojlr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 23rd December 2005, 02:42

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