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 support@ccsinfo.com

out of ROM (again)

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



Joined: 26 Aug 2004
Posts: 23
Location: California

View user's profile Send private message

out of ROM (again)
PostPosted: Thu Aug 26, 2004 5:09 pm     Reply with quote

Yes, I've searched the archives.
For a 16F628, with 2K of ROM, how big is a "code page"? 512 bytes, maybe.
After Running Out of ROM, I broke things down, and added #separate statements. From the LST file, these appear to be 108, 74, 104 & 431 bytes long. The Output window shows ROM usage of 92%. The largest (431) is only 84% of 512.
Plus the total is only 730 out of 2048, so I should have plenty to play with.
I moved a long offending calcualtion off by itself, so the 431 is now only 361 (70% of 512). But I still am showing 88%. If the CCS calculation is that far off, it will be hard to figure out where to move things. Or am I doing something wrong?
TIA
Don[/i]
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 26, 2004 5:48 pm     Reply with quote

The 16F628 data sheet doesn't show any partitioning of the program
memory into code pages. It's one continuous page of 2 KB length.
Don P



Joined: 26 Aug 2004
Posts: 23
Location: California

View user's profile Send private message

16F628 out of ROM
PostPosted: Thu Aug 26, 2004 6:00 pm     Reply with quote

PCM programmer wrote:
The 16F628 data sheet doesn't show any partitioning of the program
memory into code pages. It's one continuous page of 2 KB length.


Thanks for the reply. But that only deepens the problem. Breaking up the code and adding #separate directives alleviated the Out of ROM problem when it first occured. But from what you say, it sounds like that shouldn't have made any difference.
Also, if I add up segments from the LST file, I'm only at 730 bytes, so why should I be out of ROM?
TIA
Don
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Aug 26, 2004 7:09 pm     Reply with quote

The .LST file doesn't show everything. Some of the CCS library code
is hidden. To see it, edit the 16F628.H file, and temporarily comment
out the #nolist statement at the top of the file. Then re-compile and
look at the .LST file again.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Thu Aug 26, 2004 7:22 pm     Reply with quote

Also, in some versions of the compiler the ROM taken by the constant arrays (that are defined globally) is not shown in the .LST file either.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 26, 2004 10:38 pm     Reply with quote

You can also view the program memory.
Don P



Joined: 26 Aug 2004
Posts: 23
Location: California

View user's profile Send private message

PostPosted: Sun Aug 29, 2004 3:31 pm     Reply with quote

"Viewing Program Mem" shows empty bytes from $7B0 - $7FF, 79 bytes. Is there something that prevents me from using some of these? I have some more code to add, but when I expand an existing string by a few bytes I can get a point where one more byte gets me Out of ROM, even though 1 byte less shows me with tens of bytes left. Any guesses there?
Regards,
Don
alexbilo



Joined: 01 Jun 2004
Posts: 39
Location: Trois-Rivières

View user's profile Send private message

PostPosted: Mon Aug 30, 2004 8:03 am     Reply with quote

Quote:

I have some more code to add, but when I expand an existing string by a few bytes I can get a point where one more byte gets me Out of ROM


I guess it all depends on what you are trying to add. If, say, you add code that refers to functions that weren't used before, these functions will be stored in memory and eat up far more memory that you would expect.

Good luck,
_________________
Alex
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Aug 30, 2004 10:22 am     Reply with quote

Quote:
"Viewing Program Mem" shows empty bytes from $7B0 - $7FF, 79 bytes. Is there something that prevents me from using some of these?

If you are using the ICD is does take up some code.
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