LCD -- melabs sample program


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: LCD -- melabs sample program

    The only difference I can see between your example code and the code I use for LCD in my projects is that my code has
    Code:
    DEFINE LCD_COMMANDUS 2000               ' Command delay time in us 
    DEFINE LCD_DATAUS 50                    ' Data delay time in us
    After the definition for LCD_Lines

    Code:
    DEFINE LCD_DREG  PORTB                  ' LCD Data port
    DEFINE LCD_DBIT  0                      ' starting Data bit (0 or 4)
    DEFINE LCD_EREG  PORTB                  ' LCD Enable port
    DEFINE LCD_EBIT  5                      '     Enable bit  (on EasyPIC 5 LCD)
    DEFINE LCD_RSREG PORTB                  ' LCD Register Select port
    DEFINE LCD_RSBIT 4                      '     Register Select bit   (on EasyPIC 5 LCD)
    DEFINE LCD_BITS  4                      ' LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 4                      ' number of lines on LCD
    DEFINE LCD_COMMANDUS 2000               ' Command delay time in us 
    DEFINE LCD_DATAUS 50                    ' Data delay time in us
    I always use PORTB as I have an EasyPIC development board and that's the default wiring for the LCD, so can't comment on using pins on other ports for the enable / reset lines, but in theory, if they are set to digital it should be OK

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: LCD -- melabs sample program

    Yes Scampy, I had that in the code as well but commented it out -- tried it both ways. No go. This is so weird. And yes, I have rw tied to ground but not the unused data pins on the LCD -- heading to the workbench to try that.

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: LCD -- melabs sample program

    always something embarrassing -- in my frustration to try everything, forgot to move data to db0 - db3. it was still on the default of db4 -- db7

    head in sand.

  4. #4
    Join Date
    May 2012
    Location
    Merseyside, UK
    Posts
    237


    Did you find this post helpful? Yes | No

    Default Re: LCD -- melabs sample program

    Quote Originally Posted by Michael View Post
    always something embarrassing -- in my frustration to try everything, forgot to move data to db0 - db3. it was still on the default of db4 -- db7

    head in sand.
    I did exactly the same the other day......Any room in that sand ???

    Andy

Similar Threads

  1. Lcd 16x2 circuit and sample program...
    By larzazral in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 22nd July 2012, 11:21
  2. melabs U2 programmer won't program 12F675
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st November 2011, 01:14
  3. meLabs Program Header aid
    By boroko in forum General
    Replies: 0
    Last Post: - 13th November 2009, 09:37
  4. CTCSS Tone Decoder Sample Program
    By sozkarabacak in forum General
    Replies: 0
    Last Post: - 20th October 2009, 06:15
  5. DS1307 sample Program
    By Mark in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th September 2004, 02:25

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