Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Trouble w/ "org" commands and MPLAB...

Status
Not open for further replies.

lpinkai

New Member
This seems obvious, so I'm hoping someone can just mention what I'm doing wrong....

If I enter source code into MPLab w/ "org", it doesn't seem to like it. Ex:
list p=16F628A
include <p16F628A.inc>
__CONFIG 0x3F34
org 0

Fails:
Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016


I've cut and pasted code by William and Nigel exactly, and I always get this error. If I replace "org 0" with "MAIN", it compiles correctly. Is this something strange w/ MPLAB or am I just setting it up wrong?

-LP
 
Hmm... Not sure about that...

So you're suggesting doing "list" after "include" and "__CONFIG", as follows:

include <p16F628A.inc>
__CONFIG 0x3F34
list p=16F628A
org 0

Tried that and same error occurs:

Error - section '.org_0' can not fit the absolute section. Section '.org_0' start=0x00000000, length=0x00000016
Errors : 1

Are you using MPLab, and using this "org 0" command?

-LP
 
Hi,

I believe its, 'list', '#include', 'config', then 'org 0x000'. At least thats whats in the templates in MPLAB. In C:\Program Files\MPLAB IDE\MCHIP_Tools\TEMPLATE\Code

I've never used 'org 0' because it doesn't compile.

Blueteeth.
 
You are using a linker file and trying to write absolute code. Delete all files from the project except the .asm file and it will compile OK.

Mike.
 
Linker was my problem...

Pommie was correct (and I knew I was overlooking something obvious). I had the linker file associated with my project. Once deleted, I could do absolute code, including using the org command. Thanks!!!

-LP
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top