Finding reason for ERROR message MPLABX

Thread Starter

Peaches41

Joined Dec 15, 2016
70
Thank you for viewing my post. In my program for a PIC16f690 I am working on, I am finding the following error:

Section '.org_2 can not fit the absolute section. Section '.org_2' start= 0x00000005, length=0x00001204

I have this file listed in source file as a .asm file which is correct. All other folders in my projects folder are empty. I know that I have not gone over a page boundary as I look at my program memory in MPLABx.

I have no "code" listings as I am in absolute and use "org".

I have org 0x00, and 0x04 but no other org accept for 0x05 just after MAIN in my program.

As per the datasheet, page 0x05 is the start of page 0 and 0x800 is the start of page 1.

Any suggestions would be of help to allow me to solve this issue I am having.

Thank you.

Peaches
 

JohnInTX

Joined Jun 26, 2012
4,787
It looks like you are out of program memory.
The 690 has 1000h (4096) words of program memory in 2 banks. Your error says the length of the segment is 1204h (4612) words.
Section '.org_2 can not fit the absolute section. Section '.org_2' start= 0x00000005, length=0x00001204
Time to start squeezing.
 

Thread Starter

Peaches41

Joined Dec 15, 2016
70
It looks like you are out of program memory.
The 690 has 1000h (4096) words of program memory in 2 banks. Your error says the length of the segment is 1204h (4612) words.

Time to start squeezing.
John,
Thank you for your "constructive" advice to help me try and solve this issue. I was wondering if that(1204h) was the total amount of used words. I will continue to squeeze.

Peaches
 

JohnInTX

Joined Jun 26, 2012
4,787
I was wondering if that(1204h) was the total amount of used words. I will continue to squeeze.
Yeah, in midrange, each bump of the program counter is one 14bit word. Your case is a bit worse than that as the segment starts at 0005h meaning 5 fewer words available (you used some in the other segments at ORG 0 and ORG 004h). Also, don't forget that the code does not readily flow across the 2K bank boundaries without manually setting PCLATH bits - burning more code.

Aside: The marketeers used to like to compute the number of bits in the program memory (14*number of words) and divide by 8 to show more bytes of program memory to better compare with byte-oriented processors like the 8051... that generated a lot of confusion for new users.

But as long as you are squeezing, my personal advice is to squeeze a few bucks out of the coin jar and upgrade to 18F or at least 16F1xxx Enhanced Midrange. The effort will be way worth it.
Have fun!
 
Last edited:

Thread Starter

Peaches41

Joined Dec 15, 2016
70
As long as you are squeezing said:
John,
I had ordered a few PIC18F26k22 earlier this afternoon as I was looking for an upgrade (2 euarts, more port pins, etc) in a few peripherals to give me more room to 'grow'.
Thanks again. Enjoy your evening.


Peaches
 
Top