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

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 ; 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

Reply to
e2
Loading thread data ...

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.

Reply to
cbarn24050

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

Reply to
electro

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 ; processor specific variable definitions

Change the part name to suit the device you are using.

Reply to
Tom Lucas

yes i already did it..

Reply to
electro

yes i already did it..

Reply to
electro

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 
 Click to see the full signature
Reply to
CBFalconer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.