+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Newbie level 3
    Points: 948, Level: 6

    Join Date
    Oct 2007
    Posts
    3
    Helped
    0 / 0
    Points
    948
    Level
    6

    preprocessor symbol `__debug is defined.

    I upgraded to MPLAB V8.01 and deleted my first 16F626A program in the process which compiled and ran without errors in the previous version of MPLAB simulator.
    I have copied and pasted my original program into MPLAB V8.01 and get the following error message:

    Debug build of project `C:\Projects\16F628A Ver2 31 December 2007.mcp' started.
    Preprocessor symbol `__DEBUG' is defined.
    Mon Dec 31 08:44:06 2007
    ----------------------------------------------------------------------
    Clean: Deleting intermediary and output files.
    Clean: Deleted file "C:\Projects\16F628ATMPO.o".
    Clean: Deleted file "C:\Projects\16F628ATMPO.lst".
    Clean: Done.
    Executing: "C:\Program Files\Microchip\MPASM Suite\MPAsmWin.exe" /q /p16F628A "16F628ATMPO.ASM" /l"16F628ATMPO.lst" /e"16F628ATMPO.err" /o"16F628ATMPO.o" /d__DEBUG=1
    Message[313] C:\PROJECTS\16F628ATMPO.ASM 76 : CBLOCK constants will start with a value of 0.
    Executing: "C:\Program Files\Microchip\MPASM Suite\MPLink.exe" "16f628a.lkr" "16F628ATMPO.o" /z__MPLAB_BUILD=1 /z__MPLAB_DEBUG=1 /o"16F628A Ver2 31 December 2007.cof" /M"16F628A Ver2 31 December 2007.map" /W
    MPLINK 4.15, Linker
    Copyright (c) 2007 Microchip Technology Inc.
    Error - section 'RESET_VECTOR' can not fit the absolute section. Section 'RESET_VECTOR' start=0x00000000, length=0x00000046
    Errors : 1

    Link step failed.
    ----------------------------------------------------------------------
    Debug build of project `C:\Projects\16F628A Ver2 31 December 2007.mcp' failed.
    Preprocessor symbol `__DEBUG' is defined.
    Mon Dec 31 08:44:07 2007
    FAILED
    ----------------------------------------------------------------------

    Can someone please tell me what I am now doing wrong?
    Thanks
    Syd

    •   Alt30th December 2007, 22:52

      advertising

        
       

  2. #2
    Full Member level 3
    Points: 2,495, Level: 11

    Join Date
    Feb 2006
    Posts
    172
    Helped
    26 / 26
    Points
    2,495
    Level
    11

    preprocessor symbol `__debug is defined

    You had a linking error, your program is occupying the reset vector, whose length is usually 5 words. Did you create a project? If yes, try removing the file '16f628a.lkr' from your project.

    Show us how you set up the project, or read the 'MPLAB IDE Quick Start Guide' (DS51281).

    Cheers,



    •   Alt30th December 2007, 23:27

      advertising

        
       

  3. #3
    Newbie level 3
    Points: 948, Level: 6

    Join Date
    Oct 2007
    Posts
    3
    Helped
    0 / 0
    Points
    948
    Level
    6

    mplab link step failed

    This is my code which gives the error:

    list p=16F628A ; list directive to define processor
    #include <p16F628A.inc> ; processor specific variable definitions

    errorlevel -302 ; suppress message 302 from list file


    __CONFIG _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_ON & _WDT_OFF & _PWRTE_ON & _INTOSC_OSC_NOCLKOUT


    ; '__CONFIG' directive is used to embed configuration word within .asm file.
    ; The lables following the directive are located in the respective .inc file.
    ; See data sheet for additional information on configuration word settings.



    ;***** VARIABLE DEFINITIONS (examples)

    ; example of using Shared Uninitialized Data Section
    ; INT_VAR UDATA_SHR
    ; w_temp RES 1 ; variable used for context saving
    ; status_temp RES 1 ; variable used for context saving


    ;*********Reserve space to store count values starting at 0x20************
    cblock ; 0x20
    count1
    count2
    count3
    endc
    ;************************************************* *******

    RESET_VECTOR CODE 0x000 ; processor reset vector
    goto main ; go to beginning of program

    ;************************************************* *************************

    main ; Label main

    ; Setup of Ports A & B

    clrf PORTA
    clrf PORTB

    movlw 0x07 ; Place 07 into w register and Turn Off Comparators
    movwf CMCON ; Enable Pins for i/o functions

    ; Set RP0/RP1 = 01 in Status register to select Bank 1 containing the TRISA and TRISB
    ; Then set the pins on PORTA and PORTB Lo = Outputs and Hi = Inputs
    bcf STATUS, RP1 ; Clears RP1 = 0
    bsf STATUS, RP0 ; Sets RP0 = 1 to select Bank 1

    movlw b'00000000' ; Value for setting Port as Outputs (Lo)

    movwf TRISB ; Set Port B all as outputs (FF = 0000 0000) (All set as outputs)
    movwf TRISA ; Set Port A all as outputs (DF = 0001 0100) (Pin 4 RA5 only an Input)

    ; Set RP0/RP1 = 00 in Status register to select Bank 0
    ; Set Status Bit = 0 to select Bank 0 (RP1 =0 already set above)
    bcf STATUS, RP0

    Loop ; Label

    ; Switch Port Pins Hi = On = 1 for LED's
    movlw 0xff ; ff = 11111111

    movwf PORTA ; Set all Port A as Outputs Hi - (Problem DF = 1101 1111 Pin4 RA5 is only an input)
    movwf PORTB ; Set all Port B as Outputs Hi -

    ;Waist 2msescs to ensure the pins go fully Hi and then Delay routine to keep Hi for a while
    NOP ; 1 mSec delay with 4 MHz Oscillator
    NOP ; 1 mSec delay
    call Delay ; Increases the On time to 1 Second using delay routine
    ; Switch all Port pins Lo = Off = 0

    clrf PORTA ; Set all Port A Outputs Lo
    clrf PORTB ; Set all Port B Outputs Lo
    call Delay ; Increases the Off time to 1 Second using delay routine
    goto Loop ; Go back to loop label and do it again

    ; The 250msec Delay Subroutine (4MHz clock)
    ; First Store the values in the variables (Count1 = 250, Count2 = 199, Count3 = 1)

    Delay movlw d'250' ; Place Decimal 250 into w register
    movwf count1 ; Store 250 in count1 variable

    d1 movlw 0xC7 ; Place C7 = Decimal 199 into w register
    movwf count2 ; Store 199 in count2 variable

    movlw 0x01 ; Place 01 = Decimal 1 into w register
    movwf count3 ; Store 1 in count3 variable

    Delay_0 decfsz count2, F ; Decrement count 2 (199)
    ; and Skip next line if count2 = 0
    goto $+2 ; goto 2 lines down"goto d1"
    decfsz count3, F ; Decrement count3 (1)
    ; and Skip the next line if count3 = 0
    goto Delay_0

    decfsz count1, F ; Decrement count1 (250)
    ; and kip if count1 = 0
    goto d1 ; go back to d1
    retlw 0x00 ; Return from subroutine with 0 in w register

    goto main ; loop forever, remove this instruction, for test only

    ; initialize eeprom locations

    ; EE CODE 0x2100
    ; DE 0x00, 0x01, 0x02, 0x03


    END ; directive 'end of program'



    goto main ; loop forever, remove this instruction, for test only



    •   Alt31st December 2007, 23:06

      advertising

        
       

  4. #4
    Full Member level 3
    Points: 2,495, Level: 11

    Join Date
    Feb 2006
    Posts
    172
    Helped
    26 / 26
    Points
    2,495
    Level
    11

    link step failed mplab

    - Start MPLAB IDE
    - Select 'File>New' from 'File' menu
    - Paste your program into the new file
    - Save it with whatever filename you like, and with a '.asm' extension
    - Select 'Project>Quickbuild <yourfilename>.asm' from 'Project' menu (or hit Alt-F10)

    Another way is to put 'org 5' before your 'main' label.

    Cheers,


    1 members found this post helpful.

  5. #5
    Member level 4
    Points: 1,655, Level: 9

    Join Date
    Oct 2007
    Posts
    76
    Helped
    7 / 7
    Points
    1,655
    Level
    9

    mplab initialize eeprom

    As namqn wrote, put " org 0x05" just before the label "main" (let say, just "on top").
    regards


    1 members found this post helpful.

    •   Alt1st January 2008, 14:45

      advertising

        
       

  6. #6
    Junior Member level 3
    Points: 1,434, Level: 8

    Join Date
    Jul 2008
    Posts
    26
    Helped
    3 / 3
    Points
    1,434
    Level
    8

    Re: Help Newbie MPLAB V8.01 Program error

    I had a same problem but solved by the way namqn told. Thanx namqn.:D



+ Post New Thread
Please login
--[[ ]]--