help with 4 x 20 LCD


Results 1 to 15 of 15

Threaded View

  1. #11
    Join Date
    May 2013
    Location
    australia
    Posts
    2,653


    Did you find this post helpful? Yes | No

    Default Re: help with 4 x 20 LCD

    .....it looks more like Klingon or Greek.
    because you still have it wrong



    DEFINE LCD_DREG PORTD

    DEFINE LCD_DBIT 4 from manual ' Set starting Data bit (0 or 4) if 4-bit bus



    DEFINE LCD_RSREG PORTE
    DEFINE LCD_RSBIT 0
    DEFINE LCD_EREG PORTE
    DEFINE LCD_EBIT 1
    DEFINE LCD_RWREG PORTE
    DEFINE LCD_RWBIT 2


    DEFINE LCD_BITS 8 from manual Set LCD bus size (4 or 8 bits)

    The LCD may be connected to the PIC MCU using either a 4-bit bus or an 8-bit
    bus. If an 8-bit bus is used, all 8 bits must be on one port. If a 4-bit bus is used,
    the top 4 LCD data bits must be connected to either the bottom 4 or top 4 bits of
    one port.




    DEFINE LCD_LINES 4
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50

    the one thing not mentioned in the manual is to ground the unused pins d0-d3 if using a 4 bit bus.
    it can be difficult to init disp under some conditions if this is not done.

    if you use 8bit bus then the pins should be connected sequentially port.0 -> d0 ..... port.7 -> d7
    Last edited by richard; - 23rd February 2018 at 21:10.
    Warning I'm not a teacher

Similar Threads

  1. Using a parallel LCD(44780 based) as a serial LCD
    By mikejp56 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 30th October 2015, 01:56
  2. Replies: 36
    Last Post: - 14th March 2011, 18:38
  3. Replies: 2
    Last Post: - 5th November 2009, 17:07
  4. LCD and PIC18F2685 - Weird LCD behavior
    By Castor in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th April 2008, 09:55
  5. to convert LCD // hd 44780 --> serial LCD
    By in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th March 2003, 12:37

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