LCD using 4 data lines, Lab X1


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108

    Default LCD using 4 data lines, Lab X1

    I'm running a LabX1 with PIC 16F887. The schematic shows 8 data lines connected to port D of the MCU and the sample routines I have been using have the following defines:

    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTE
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTE
    DEFINE LCD_EBIT 1

    The PBPro3 manual has an example with an LCD using only 4 bits D4-D7 using the "default values" of DEFINE LCD_DBIT 0 with the comment 'Set starting data bit (0 or 4) if 4-bit bus.

    Q.1 So I'm confused. It appears if you use 8 lines (LabX1) you DEFINE LCD_DBIT 4 but if you only have 4 lines (example in book) you DEFINE LCD_DBIT 0. Isn't this backwards?

    I want to use an LCD with a 16F88 and I may not have enough ports to use 8 data lines.

    Q.2 The PBPro3 manual also has a define for LCD bus size called "LCD_BITS" which should be set to 4 or 8 depending on the # of bits used and for the book example is set "correctly" to 4. This DEFINE is not in the LabX1 routines. Does it default to 8 bits?

  2. #2
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: LCD using 4 data lines, Lab X1

    I think I answered my own question....
    The LabX1, despite showing all 8 data lines connected to the LCD, is operating in 4 bit mode. (I can tell by the simultaneous connected LEDs flashing). Thus the DEFINE should be LCD_DBIT 4 (start with 4th bit). The default in PBP3 for LCD_bits is 4 and since this is not defined explicitly in the DEFINES in the program (above) this is what it defaults to.

    Still have a question about the schematic showing 8 lines connected and when I change the DEFINEs to reflect 8 lines, the display does not work (random flashing characters).

Similar Threads

  1. LCD Low Power
    By kduck63 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2012, 01:05
  2. 44780 LCD - Why would I use 8 data lines?
    By andywpg in forum Off Topic
    Replies: 4
    Last Post: - 27th March 2012, 19:25
  3. shared data lines for LCD and LED'S?
    By nomad in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th February 2009, 05:37
  4. Data and power over 2 lines
    By ecoli-557 in forum Serial
    Replies: 10
    Last Post: - 15th October 2008, 19:18
  5. Data on DC power lines?
    By boroko in forum Serial
    Replies: 2
    Last Post: - 21st February 2008, 16:34

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts