why do we need to define lCD_COMMANDUS and LCD_DATAUS


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2006
    Posts
    21

    Default why do we need to define lCD_COMMANDUS and LCD_DATAUS

    Dear Freinds ...

    I can't understand precisely what is the delay we control using these two defines :

    DEFINE LCD_COMMANDUS 1000 ' SET COMMAND DELAY TIME IN us.
    DEFINE LCD_DATAUS 40 ' SET DATA DELAY TIME IN us.

    Please help me to understand precisely what we aim to control through these defines ... also , What are the defaults ?

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tamersoss View Post
    Dear Freinds ...
    I can't understand precisely what is the delay we control using these two defines :
    DEFINE LCD_COMMANDUS 1000 ' SET COMMAND DELAY TIME IN us.
    DEFINE LCD_DATAUS 40 ' SET DATA DELAY TIME IN us.
    Please help me to understand precisely what we aim to control through these defines ... also , What are the defaults ?
    A parallel LCD, Hitachi 44780 compatible LCD, is basically a smart LCD. It has a processor of sorts, it's own RAM, it's own way of talking. So basically, when you LCDOUT, you ARE communicating with another processor.
    Those delays are needed to let the LCD processor have time to do what it needs to do.
    In short, start big and work your way down until the LCD fails, then add a bit for a fudge factor.
    CommandUs (word value) generally works with 1000, but some LCDs want 2,000 or more.
    DataUs (byte value) usually works at 100, again, some want more.

    Most of the LCDs I've got here in my shop will work with as little as CommandUs of 200 and DataUs of 35.
    YMMV...

  3. #3


    Did you find this post helpful? Yes | No

    Default Allows for fast or slow LCDs

    You can usually ignore the delay functions and a great many LCDs will work perfectly. I have found some of the cheaper brands need extra time to get the job done and this is where the choice of a data and a command delay are useful.

    When the RS (Register Select) line is 0 you are writing an INSTRUCTION to the LCD which probably will not be displayed but will cause some internal action such as cursor positioning. This can take a relatively long time.
    DEFINE LCD_COMMANDUS 1000 ' SET COMMAND DELAY TIME IN us.

    When RS is 1 you are writing DATA to be displayed. Typically this is faster.
    DEFINE LCD_DATAUS 40 ' SET DATA DELAY TIME IN us.

    My suggestion is to comment out these two defines and only invoke them if you have a display problem.

    HTH
    BrianT

  4. #4
    Join Date
    Dec 2006
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    But i need to know the meening of lcd command delay and data delay ... In my application i have to know the time period every statement consums ... so i need to understand when these delays take place ?

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tamersoss View Post
    But i need to know the meening of lcd command delay and data delay ... In my application i have to know the time period every statement consums ... so i need to understand when these delays take place ?
    Huh? Didn't I just tell you what the DEFINE's meant?
    Light an LED before the LCD command, turn off the LED after the LCD command, measure the pulse width on a 'scope. Or run it thru the MPLAB simulator...

  6. #6
    Join Date
    Dec 2006
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Ok ... Many thanks ... i will try it.

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