Running an LCD on different port


Results 1 to 8 of 8

Threaded View

  1. #1
    malc-c's Avatar
    malc-c Guest

    Default Running an LCD on different port

    Quick question..(hopefully)

    In the PBP manual it details the use of PortB to interface with a 2 x 16 LCD.

    PBP assumes the LCD is connected to specific pins unless told otherwise. It assumes the LCD will be used with a 4-bit bus with data lines DB4 - DB7 connected to PICmicro PORTA.0 - PORTA.3, Register Select to PORTA.4 and Enable to PORTB.3.

    It is also preset to initialize the LCD to a 2 line display.

    To change this setup, place one or more of the following DEFINEs, all in upper-case, at the top of your PICBASIC PRO™ program:

    ' Set LCD Data port
    DEFINE LCD_DREG PORTB
    ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_DBIT 4
    ' Set LCD Register Select port
    DEFINE LCD_RSREG PORTB
    If I wanted to use PORTC for the LCD display on a 16F873A PIC would the following work if the wiring was the same as shown in the manual (obviously substituting RA1 for RC1 etc)?


    ' Set LCD Data port
    DEFINE LCD_DREG PORTC
    ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_DBIT 4
    ' Set LCD Register Select port
    DEFINE LCD_RSREG PORTC
    is there anything eles I would need to do to configure PORTC on the PIC other than TRISC=%00000000, for arguments sake disabling the rx / tx on ports RC7 and 6 ?
    Last edited by malc-c; - 17th December 2006 at 20:16.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 19:14
  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. LCD R/S works on Port A but not Port B
    By TDonBass in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 10th February 2009, 12:41
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27

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