Re: PIC16F628A Error: section '.org_0' can not fit the absolute section




"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


.



Relevant Pages

  • Re: PIC16F628A Error: section .org_0 can not fit the absolute section
    ... overlapping an interrupt vector. ... a_data res 1;0x80 ... move status register into W register ... movwf status_temp; save off contents of STATUS register ...
    (sci.electronics.design)
  • Re: Problem with asm
    ... but I have to think that loading an absolute ... >>address into a pointer cannot be wrong, ... > register generates a fault. ...
    (comp.lang.c)
  • Re: Absolute jump without register?
    ... > With the aid of a register it looks like this and jumps to the desired ... your choices for operands are register, memory, or immediate... ... absolute, and the SHORT/NEAR/LONG formats which are relative to $+2... ...
    (comp.lang.asm.x86)
  • Re: Problem with asm
    ... The problem is that you *cannot* load an absolute address into a pointer ... >> register generates a fault. ...
    (comp.lang.c)
  • register to an ISR
    ... while writing the device drivers the normal ... practice is to associate the device with some interrupt vector and register ... How do we register a callback for a particular device? ... Is there a possibility to register a callback for both user space and kernel ...
    (comp.os.linux.embedded)