Redefinition of VAR errors in PIC14EXE.BAS AND PBPPIC14.RAM


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    May 2012
    Location
    Contractor, Afghanistan
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Redefinition of VAR errors in PIC14EXE.BAS AND PBPPIC14.RAM

    Here is the program. I seem to have some issues with uploading my files. I will continue to try.
    '************************************************* ***************

    '* 16F877.BAS *
    '* *
    '* By : Leonard Zerman, Jeff Schmoyer *
    '* Notice : Copyright (c) 1998 microEngineering Labs, Inc. *
    '* All Rights Reserved *
    '* Date : 10/23/98 *
    '* Version : 2.11 *
    '* Notes : *
    '************************************************* ***************
    LIBRARY"PBPPIC14"
    include"PIC14EXT.BAS"
    include"PBPPIC14.RAM"
    BANK0 $0020, $007F
    BANK1 $00A0, $00EF
    BANK2 $0110, $016F
    BANK3 $0190, $01EF
    EEPROM $2100, $21FF

    DEFINE CODE_SIZE 8
    ;PORTL VAR PORTB
    ;PORTH VAR PORTC
    ;TRISL VAR TRISB
    ;TRISH VAR TRISC


    TRISB = $00
    TRISD = $00
    TRISA = $00
    TRISC = $FF
    TRISE = $00

    START:


    TimeSet:
    PORTD = %10110110 ;data previously loaded into DispReg1 is sentto DispData which is PortD.
    PORTB = %10000000 ;data previously loaded into DispDriveReg is sent toDispdrive which is PortB.
    call KbdScan ;callKbdScan to see if one or more keys have been pressed.
    PORTD = %10011110
    PORTB = %01000000
    call KbdScan
    PORTD = %00100010
    PORTB = %00100000
    call KbdScan
    PORTD = %00000000
    PORTB = %00010000
    call KbdScan
    PORTD = %00100010
    PORTB = %00001000
    call KbdScan
    PORTD = %00001000
    PORTB = %00000100
    call KbdScan
    PORTD = %00101000
    PORTB = %00000010
    call KbdScan
    PORTD = %10011110
    PORTB = %00000001
    call KbdScan
    goto TimeSet

    KbdScan:
    Pause 8
    goto TimeSet





    '*-----------------------*EOF 16F877.BAS *---------------------*

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: Redefinition of VAR errors in PIC14EXE.BAS AND PBPPIC14.RAM

    You're not supposed to write your program INSIDE any of the files in the PBP folder.

    When you compile a program the compiler automatically includes the correct files for the specified target - in your case (since you're using the 16F877) the file is 16F877.BAS (and a few other) but now, since you've "added" you're program code TO that file it won't work since the compiler tries to compile the same code twice - sort of.

    Simply keep your program code in a file of its own and compile for the correct target. If you're using MicroCodeStudio as your IDE it's just a matter of selecting the 16F877 in the dropdown list of available targets. Make you sure you restore the 16F877.BAS file to its original state.

    /Henrik.

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