Beginners Question


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    sawicki's Avatar
    sawicki Guest

    Default Beginners Question

    I just bought a copy of Picbasic Pro and tried my first program, the LCD sample with the error shown below. Could someone tell me what I'm doing wrong or point me to the appropriate instructions?

    Thanks,

    Felix
    __________________________________________________ ___________
    Executing: "H:\PBP\PBPW.EXE" -p16F688 -ampasmwin -oq -z -v "LCD.bas"
    PicBasic Pro Compiler 2.46, (c) 1998, 2005 microEngineering Labs, Inc.
    All Rights Reserved.
    Pass 1:
    Pass 2:
    Code Gen:
    Macro Pass:
    mpasmwin /q "H:\Pic Projects\Test Basic\LCD.ASM"
    COD Pass:
    Warning[219] H:\PBP\PBPPIC14.LIB 2780 : Invalid RAM location specified.
    Warning[219] H:\PBP\PBPPIC14.LIB 2785 : Invalid RAM location specified.
    Warning[219] H:\PBP\PBPPIC14.LIB 2909 : Invalid RAM location specified.
    Warning[219] H:\PBP\PBPPIC14.LIB 2930 : Invalid RAM location specified.
    BUILD SUCCEEDED: Sun Jun 12 20:07:44 2005
    _______________________________________
    ' PicBasic program to demonstrate operation of an LCD in 4-bit mode
    '
    ' LCD should be connected as follows:
    ' LCD PIC
    ' DB4 PortA.0
    ' DB5 PortA.1
    ' DB6 PortA.2
    ' DB7 PortA.3
    ' RS PortA.4 (add 4.7K pullup resistor to 5 volts)
    ' E PortB.3
    ' RW Ground
    ' Vdd 5 volts
    ' Vss Ground
    ' Vo 20K potentiometer (or ground)
    ' DB0-3 No connect

    Pause 500 ' Wait for LCD to startup

    loop: Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "Hello" ' Display Hello
    Pause 500 ' Wait .5 second

    Lcdout $fe, 1 ' Clear LCD screen
    Lcdout "World"
    Pause 500 ' Wait .5 second

    Goto loop ' Do it forever

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


    Did you find this post helpful? Yes | No

    Default

    You get this error because there is no PORTB on the 16F688. Only PORTA,
    and PORTC.

    Invalid RAM location specified is returned because the LCDOUT library
    function is attempting to use an I/O port that is not defined in the device
    header file for the 16F688.

    Use the LCDOUT defines "shown in your manual" to reassign PORTA & PORTC
    for LCDOUT control I/O-pins.

    Tip: You will also want to turn off A/D & comparators with;

    ANSEL = 0 ' All pins digital
    CMCON0 = 7 ' Comparators disabled
    CMCON1 = 0 ' For RA4
    Regards,

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

  3. #3
    sawicki's Avatar
    sawicki Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Bruce

    I added

    DEFINE LCD_EREG PORTA
    DEFINE LCD_EBIT 5

    and it works just as it should. Thanks also for the other tips.

    Felix

Similar Threads

  1. Shiftout question.
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd April 2007, 15:57
  2. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 14:30
  3. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  4. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49
  5. Timer / CCP Question
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd November 2005, 08:22

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