LCD in 8-bit mode

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    thesaxmachine's Avatar
    thesaxmachine Guest

    Default LCD in 8-bit mode

    What is the code to setup a PIC to drive an LCD in 8-bit mode. In the PicBasic manual it only shows how to change the port the 4 bit mode is on.



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

    Did you find this post helpful? Yes | No


    See manual again (it's all there) and try this:

    'Below defines make:
    'PortA.0 = enable
    'PortA.1 = select
    'PortB = the 8 bit bus
    'Adjust to meet your needs ...

    DEFINE LCD_DBIT 0 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTA ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTA ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 8 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
    DEFINE LCD_DATAUS 50 ' Set data delay time in us

    Good Luck,
    Paul Borgmeier
    Salt Lake City, Utah

Similar Threads

  1. LCD freeze
    By harryweb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th October 2009, 08:01
  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. first project, and yes, doesn`t work
    By bogdan in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 28th April 2009, 06:13
  4. Migrating from PIC16F690 to PIC18F4525 and having LCD issues
    By jblackann in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th June 2008, 20:05
  5. How to work with LCD in a mode of 8 bits?
    By MCU Destroyer in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 1st July 2005, 21:10

Posting Permissions

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