Re: PIC16F628A Error: section '.org_0' can not fit the absolute section
- From: "Paul E. Schoen" <pstech@xxxxxxxxx>
- Date: Tue, 4 Sep 2007 11:34:17 -0400
"Syd" <sydceeoz@xxxxxxxxx> wrote in message
news:1188894054.994755.104640@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am a newbie trying to write a simple program using MPlab IDE using a
P16F628A.
When I click on Build All the assempler produces this error message:
"Error - section '.org_0' can not fit the absolute section. Section
'.org_0' start=0x00000000, length=0x0000003e
Errors : 1"
Can someone please tell me what is meant by "cannot fit the absolute
section" and how to correct it.
Thanks in anticipation of some help.
Syd
I would need to see the rest of the code to see how you have it set up. You
may have a problem with a relocatable section, or your code at origin 0 is
overlapping an interrupt vector (usually located at 0x04 or 0x08).
If you use absolute addresses for code, you should use a jump instruction
at ORG 0 to branch to another absolute location past the interrupt vectors.
Using relocatable code, do it like this:
; Data can be located in a specific address space,
; or leave off the address to allow the linker to locate it
group1 UDATA 0x80
a_data res 1 ;0x80
b_data res 1
c_data res 1
;****************** Reset vector ********************
; This code will start executing when a reset occurs.
RST CODE 0x0000
goto Main ;go to start of main code
;****************************************************
; The linker is forced to locate this code at the specified address
INTVEC CODE 0x0004 ; interrupt vector location
goto Isr
;************** Interrupt Processing ****************
; This code can be relocated anywhere by the linker
CODE
Isr:
movwf w_temp ; save off current W register contents
movf STATUS,w ; move status register into W register
movwf status_temp ; save off contents of STATUS register
; Do Interrupt processing
EndIsr
movf status_temp,w ; retrieve copy of STATUS register
movwf STATUS ; restore pre-isr STATUS register contents
swapf w_temp,f
swapf w_temp,w ; restore pre-isr W register contents
retfie ; return from interrupt
;************* Start of Program ****************
Main
; Add your main code here
;************* End of Program ****************
END
.
- Follow-Ups:
- References:
- Prev by Date: Islam is the Enemy
- Next by Date: Re: NOT Political - Hilarious!
- Previous by thread: Re: PIC16F628A Error: section '.org_0' can not fit the absolute section
- Next by thread: Re: PIC16F628A Error: section '.org_0' can not fit the absolute section
- Index(es):
Relevant Pages
|