Lcd


Closed Thread
Results 1 to 11 of 11

Thread: Lcd

  1. #1
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302

    Default Lcd

    I have this defines in my code:

    DEFINE LCD_DREG PORTB 'Selection of the port B
    DEFINE LCD_DBIT 0 'Selection one RB0 with RB3
    DEFINE LCD_RSREG PORTA 'RS on port A
    DEFINE LCD_RSBIT 2 'RS on RA2
    DEFINE LCD_EREG PORTA 'E on port A
    DEFINE LCD_EBIT 3 'E on RA3
    DEFINE LCD_BITS 4 'Mode 4 bits
    DEFINE LCD_LINES 2 '2 lines

    Which is the difference if add this code:

    DEFINE LCD_COMMANDUS 2000 ' Command Delay (uS)
    DEFINE LCD_DATAUS 50 ' Data Delay (uS)

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Quote Originally Posted by savnik
    ...Which is the difference if add this code:

    DEFINE LCD_COMMANDUS 2000 ' Command Delay (uS)
    DEFINE LCD_DATAUS 50 ' Data Delay (uS)
    Actually, NOTHING - these two lines as written are the default values already defined in the library file.

    However, if your display for some reason cannot keep up with PIC's command issuing speed, you can increase the LCD_COMMANDUS term. If your display for some reason cannot keep up with your PIC's data issuing speed, you can increase the LCD_DATAUS term. These two conditions might happen when you run your PIC at "higher" clock rates (e.g., 20MHz) - it depends on your particular display. You also can decrease the values if you run your PIC at "slow" speeds.

    So ... if you are running at higher speeds and the LCDOUT appears not to work, you can increase these values until the command works (provided this is the problem as to why it is not working ).

    Paul Borgmeier
    Salt Lake City, Utah
    USA

  3. #3
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Thank you for your answer.
    PIC clock is 4 MHZ. Sometimes only when power up the pic the Lcd is not show correct.

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


    Did you find this post helpful? Yes | No

    Default

    you may need to add a LCD start up delay. Something between 500mSec to 2Sec in worst case.

    Be sure that your PIC don't have any Analog stuff on the pins you're using. If so, you must disable it.

    That could be the issue
    Steve

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

  5. #5
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    you may need to add a LCD start up delay. Something between 500mSec to 2Sec in worst case.

    Be sure that your PIC don't have any Analog stuff on the pins you're using. If so, you must disable it.

    That could be the issue
    MY code is:

    DEFINE LCD_DREG PORTB 'Selection of the port B
    DEFINE LCD_DBIT 0 'Selection one RB0 with RB3
    DEFINE LCD_RSREG PORTA 'RS on port A
    DEFINE LCD_RSBIT 2 'RS on RA2
    DEFINE LCD_EREG PORTA 'E on port A
    DEFINE LCD_EBIT 3 'E on RA3
    DEFINE LCD_BITS 4 'Mode 4 bits
    DEFINE LCD_LINES 2 '2 lines

    ADDR1=$C2

    PAUSE 100

    LCDOUT $FE, 1 ' Clear LCD screen
    LCDOUT "TUNER VHF - UHF" ' post text during 2 second
    LCDOUT $FE,$C0
    LCDOUT " LESVOS "
    PAUSE 2000



    EEPROM 0,[$0,$0]

    How to add start up delay for the LCD;

  6. #6
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    any help ;

  7. #7
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    How to add start up delay for the LCD;
    It REALLY is as simple as what Mister_E said... where you have your "pause 100" command at the moment, change it to "pause 500". This SHOULD allow enought time for the LCD to settle. If this still does not help, change it to "Pause 2000" and try that. If that still does not work, your problem is unlikely to be LCD settle time. Post back if these do not work

    Regards

    Rob

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


    Did you find this post helpful? Yes | No

    Default

    also we don't know your PIC model, it can have analog stuff on any port. If they're not disabled .. it will never work.
    Steve

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

  9. #9
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e
    also we don't know your PIC model, it can have analog stuff on any port. If they're not disabled .. it will never work.
    I use pic16f84a and pic16f628a

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


    Did you find this post helpful? Yes | No

    Default

    on PIC16F628a you'll have to disable the analog comparator
    CMCON=7

    On both you should make sure the LVP fuse is disabled before programming.

    If your Crystal is >4MHZ be sure the OSC fuse is set to HS AND you have the according DEFIN at the top of your code.

    Be sure the MCLR pin is tie to somewhere

    etc
    etc

    The blink program idea is still remain so far
    Steve

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

  11. #11
    Join Date
    Jun 2006
    Location
    Greece
    Posts
    302


    Did you find this post helpful? Yes | No

    Default

    i change PAUSE 100 to PAUSE 200 and it's ok.
    thank you.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. LCD Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  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. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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