CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

How can I use the rom till the last word?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
vos
Guest







How can I use the rom till the last word?
PostPosted: Thu Jul 26, 2007 8:10 am     Reply with quote

Hi,

I'm working with a Pic10F202 with 512 words Rom and the PCW IDE version 4.030.
I wrote a program that uses 95% or 485 word of the ROM. If I add just one instruction more (i.e. a NOP (delay_cycles(1);)) and compile the program again. I get a ERROR 71 (out of ROM) with the addition: Seg 0-1FF, 181 left, need 182.

0x181 (385 words) thats the size of my main() routine.
I have #separate used for every function. But so far I understand #separate, it won't help because the 10F202 has only one memory bank with 512 words.

I tried for test also to add one NOP within the other function but the result was always the same.

If I analyse the hex-code of the working program with the PicKit 2 Programmer, are there still 17 words unused. In the head of the .lst file of the same program it is written free segment is 27 . That would be again 10 words more.

To finish my application I need now just 4 more assembler instructions. And the analyse has shown that this space exist.

But how can I use the ROM till the last word without a compiler error?
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Thu Jul 26, 2007 8:24 am     Reply with quote

The memory space, inside of the PIC, is divided into what's called 'Pages'. These are individual sections of memory that are not connected to each other. The code is 'stuffed' into these pages. The problem is that a routine needs to be contained in One page and cannot bridge over to another page. The compiler might state that you have 95% of the memory used but that's Total memory. You might have 1% in one bank, 3.5% in another bank and so on....

The trouble is figuring out where most of your space is located and trying to move things around to fit everything. I had a project, once, that I had to streamline for the same error. If I put just one extra statement in it, it would puke.

Good luck

Ronald
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group