LCD & defaults


Closed Thread
Results 1 to 5 of 5

Thread: LCD & defaults

  1. #1
    trying's Avatar
    trying Guest

    Default LCD & defaults

    in the PBP man it states. "it assumes the LCD will be used with 4 bit bus with data lines DB4-DB7 connected to PICmicro MCU PORTA.0-PORTA.3 Register Seclect to porta.4 and enable to PORTB.3" And shows a weak pull up added to PORTA.4
    my ? is this does it also set up the I/O for this and is PORTA.4 used as a input.
    I will be using a 16f630 that has a programmable weak pull up for PORTA.4
    can I use the programmable pullup by adding my normal
    CMCON = 7 'PORTA ALL DIGITAL
    VRCON = 0 'VOLTAGE REF. DISABLE
    TRISA = %00001100 'MAKE A.3 &.4 INPUTS
    TRISC = %00000000 'MAKE ALL PORTC OUTPUTS

    OPTION_REG.7 = 0 'ENABLE WEEK PULLUPS (CLEAR RAPU)
    WPUA = %00010000 'WEAK PULLUP ON PORTA.4

    thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    You could use the internal pull-up, but it shouldn't be necessary if the pin is
    bi-directional.

    The example in your PBP manual uses a pull-up on RA4 of the PIC16F84 only
    because this pin is an open drain type output, and can only provide ground to
    the LCD RS pin.

    Look on the MeLabs site for the LAB-X4 examples. They have schematics &
    sample code for creating a serial LCD driver with a PIC16F676.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  3. #3
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Code:
     You said TRISA = %00001100                'MAKE A.3 &.4 INPUTS
    but if you look good then you made A.2 and A.3 an input and A.4 is stil in the register an output.

  4. #4
    trying's Avatar
    trying Guest


    Did you find this post helpful? Yes | No

    Smile

    thanks
    even when you cut and paste make sure what you cut is what you need
    typos are killing me

  5. #5
    trying's Avatar
    trying Guest


    Did you find this post helpful? Yes | No

    Default

    Well after alittle help here and some port changes its working
    thanks

    @ DEVICE pic16f630
    @ DEVICE pic16f630, INTRC_OSC_NOCLKOUT
    @ DEVICE pic16f630, WDT_ON
    @ DEVICE pic16f630, MCLR_OFF 'TEST LCD
    @ DEVICE pic16f630, CPD_OFF ' 16F630
    @ DEVICE pic16f630, BOD_OFF '
    @ DEVICE pic16f630, PWRT_ON
    @ DEVICE pic16f630, PROTECT_OFF
    DEFINE OSC 4
    Pause 10000 ' Allow pic to Stabilize

    CMCON = 7 'COMPARATOR OFF
    VRCON = 0 'VOLTAGE REF. DISABLE
    TRISA = %00001000 'MAKE PORTA OUTPUTS(.3 MUST BE INPUT)
    TRISC = %00000000 'MAKE ALL PORTC OUTPUTS
    SYMBOL LED= PORTA.5 'POWER UP LED
    LED=0

    DEFINE CHAR_PACING 1000
    DEFINE LCD_DREG PORTC ' Set LCD Data PORTC
    DEFINE LCD_DBIT 0 ' Set starting Data BIT (0 OR 4) IF 4-BIT bus
    DEFINE LCD_RSREG PORTC ' Set LCD Register Select PORTC
    DEFINE LCD_RSBIT 5 ' Set LCD Register Select BIT PORTC
    DEFINE LCD_EREG PORTC ' Set LCD Enable PORTC
    DEFINE LCD_EBIT 4 ' Set LCD Enable BIT PORTC.3
    DEFINE LCD_BITS 4 ' 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

    LED=1
    Pause 350 'POWER OK
    LED=0



    Pause 2000

    LCDOut $FE,1,"IT MUST BE" 'CLEAR SCREEN 'PRINT, "IT MUST BE"

    LCDOut $FE,$C0,"WORKING" '2ND. LINE PRINT "WORKING"

    End

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 Problem
    By karenhornby in forum General
    Replies: 3
    Last Post: - 19th June 2008, 11:43
  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. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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