1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

PLEASE HELP ASAP!!! .org_0 can not fit the absolute section. Section '.org_0' start=0x00000000, len

Discussion in 'Embedded' started by e2, Apr 3, 2006.

  1. e2

    e2 Guest

    please help me...
    this is my partial code ;;;;
    and the error is

    :::::::::: .org_0 can not fit the absolute section. Section '.org_0'
    start=0x00000000, length=0x0000000c :::::::::::::::

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

    __CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_OFF & _RC_OSC &
    _WRT_OFF & _LVP_OFF & _CPD_OFF

    door_lock_init EQU 0X11
    metal_detect_init EQU 0X12
    user_prompt_toggle0 EQU 0X13
    metal_detect EQU 0X14


    ORG 0X0000
    GOTO start

    start

    CALL door_lock_init
    CALL metal_detect_init
    CALL user_prompt_toggle0
    CALL metal_detect
    CALL user_prompt_toggle0

    END




    metal_detect_init BCF STATUS, RP0 ;
    BCF STATUS, RP1 ; Bank0
    CLRF PORTA ; Initialize PORTA by clearing output data latches
    CLRF PORTB ; CLEAR ALL CONTENTS
    BSF STATUS, RP0 ; Select Bank 1 CVRCON/CMCON/TRISA
    BSF TRISB,0 ; RB0 output to door motor
    BCF TRISB,1 ; RB1 input from dtr(toggle)
    MOVLW '00000111' ;

    MOVWF TRISA
    MOVLW '00000110'
    MOVWF CMCON
    MOVLW '11101100';
    MOVWF CVRCON
    RETURN
     
    e2, Apr 3, 2006
    #1
    1. Advertisements

  2. e2

    cbarn24050 Guest

    You need to check your linker settings. Your code is in the interrupt
    area, try putting org 0x0020 after goto start. You seem to have an end
    statement thats not at the end, move it.
     
    cbarn24050, Apr 3, 2006
    #2
    1. Advertisements

  3. e2

    electro Guest

    thanks..i have a problem...

    i have sets of subroutines.however,im having the error of
    error113:symbol not defined..
    please help.


    ORG 0X00
    GOTO start

    start

    CALL door_lock_init ;CONFIGURE USART FOR RECEPTION
    CALL metal_detect_init ;AFTER RESET STATE,PROGRAM STARTS METAL
    DETECTION UNIT
    CALL user_prompt_toggle0
    CALL metal_detect; OUTPUT IS A CLOSED DOOR
    ;NOW USE THE DTR AS TOGGLE FUNCTION,OPEN/CLOSE
    CALL user_prompt_toggle0

    end

    ;METALDETECT INITIALIZATION ASSUMES A HIGH LEVEL TONE FROM THE DETECTOR


    metal_detect_init BCF STATUS, RP0 ;
    BCF STATUS, RP1 ; Bank0
    CLRF PORTA ; Initialize PORTA by clearing output data latches
    CLRF PORTB ; CLEAR ALL CONTENTS
    BSF STATUS, RP0 ; Select Bank 1 CVRCON/CMCON/TRISA
    BSF TRISB,0 ; RB0 output to door motor
    BCF TRISB,1 ; RB1 input from dtr(toggle)
    MOVLW '00000111' ;
    MOVWF TRISA ; SET R5-R4 OUTPUTS,R3-R0 INPUTS
    ; RA1-RTS(INPUT UC,START METAL DETECTION)
    ; RA3-CTS(OUTPUT UC,METAL STATUS)
    ; NOTE: DTR(PIN4,INPUT)WILL RESET/OPEN DOOR,hardwired to lock motor
    MOVLW '00000110';
    MOVWF CMCON ; SET RAO AS COMPARATOR INPUT
    MOVLW '11101100';
    MOVWF CVRCON ; SET 2.5V,RA2 REF DIVIDER PIN ;MAKE 4-5v
    RETURN

    ;DOORLOCKINIT
    ;NORMALLY OPEN,'0' RB0

    door_lock_init BCF STATUS, RP0 ;
    BSF STATUS, RP1 ; Bank1
    BCF TRISB,0 ; set RB0 OUTPUT
    BCF STATUS,RP1 ; bank 0
    BCF PORTB,0 ; CLEAR RB0,NORMALLY OPEN DOOR(LOW LEVEL,0V)
    RETURN

    metal_detect
    ; BTFSC PORTA,5 ; IF IT IS SET, METAL ACTIVE,DOOR AUTOMATICALLY
    ; CLOSES SINCE RA4/C1OUT AUTOMATICALLY ACTIVATED
    ; or you may read cmcon c1out contents
    BCF STATUS, RP0 ;
    BSF STATUS, RP1 ; Bank1
    BTFSC CMCON,6 ; IF C1OUT CLEAR,DOOR IS OPEN, SKIP
    GOTO metal_detect ; DOOR STATUS IS OPEN,NO METAL DETECTED
    GOTO door_close ; METAL DETECTED CLOSE DOOR
    RETURN

    door_close
    BCF STATUS, RP0 ;
    BCF STATUS, RP1 ; Bank0
    BSF PORTB,0 ; automatically close door!
    BSF PORTA,2 ; UC WILL NOW SEND POSITIVE ALARM TO RS232 THROUGH CTS
    LINE
    ; VB will read the cts buffer and call audio warning/closed
    ; door should remain closed unless prompted from vb
    ; status change for vb program
    RETURN

    door_open
    BCF STATUS, RP0 ;
    BCF STATUS, RP1 ; Bank0
    BCF PORTB,0 ; open door!nothing to input to vb so no status change!
    RETURN



    user_prompt_toggle0
    BCF STATUS, RP0 ;
    BCF STATUS, RP1 ; Bank0
    BTFSC PORTB,1 ; IF RB1 IS clear,NO TOGGLE INPUT,SO REMAIN DOOR STATUS
    STATUS
    COMF PORTB,0 ; TOGGLE ACTIVE,SO COMPLEMENT DOOR STATUS
    RETURN
     
    electro, Apr 3, 2006
    #3
  4. e2

    Tom Lucas Guest

    <snip code>

    Have you remembered to include the header and processor definitions for your
    PIC? An example of what to put can be found in e2's post :

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

    Change the part name to suit the device you are using.
     
    Tom Lucas, Apr 3, 2006
    #4
  5. e2

    electro Guest

    yes i already did it..
     
    electro, Apr 3, 2006
    #5
  6. e2

    electro Guest

    yes i already did it..
     
    electro, Apr 3, 2006
    #6
  7. e2

    CBFalconer Guest

    Meaningless. See below to include adequate context with the broken
    google interface to usenet.

    --
    "If you want to post a followup via groups.google.com, don't use
    the broken "Reply" link at the bottom of the article. Click on
    "show options" at the top of the article, then click on the
    "Reply" at the bottom of the article headers." - Keith Thompson
    More details at: <http://cfaj.freeshell.org/google/>
    Also see <http://www.safalra.com/special/googlegroupsreply/>
     
    CBFalconer, Apr 3, 2006
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.