View previous topic :: View next topic |
Author |
Message |
Don P
Joined: 26 Aug 2004 Posts: 23 Location: California
|
out of ROM (again) |
Posted: Thu Aug 26, 2004 5:09 pm |
|
|
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
|
|
Posted: Thu Aug 26, 2004 5:48 pm |
|
|
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
|
16F628 out of ROM |
Posted: Thu Aug 26, 2004 6:00 pm |
|
|
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
|
|
Posted: Thu Aug 26, 2004 7:09 pm |
|
|
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
|
|
Posted: Thu Aug 26, 2004 7:22 pm |
|
|
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
|
|
Posted: Thu Aug 26, 2004 10:38 pm |
|
|
You can also view the program memory. |
|
|
Don P
Joined: 26 Aug 2004 Posts: 23 Location: California
|
|
Posted: Sun Aug 29, 2004 3:31 pm |
|
|
"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
|
|
Posted: Mon Aug 30, 2004 8:03 am |
|
|
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
|
|
Posted: Mon Aug 30, 2004 10:22 am |
|
|
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. |
|
|
|