View previous topic :: View next topic |
Author |
Message |
Neil_J
Joined: 11 Jun 2006 Posts: 4
|
ROM 100%? |
Posted: Sun May 06, 2007 2:42 pm |
|
|
Hi,
I have a project using the 18F25J10, seperated into individual .c and .h modules that I'm trying to compile. It originally started out for the 18F2525 as a single .c file, which I had no problems with.
Since moving to the new processor and individual .c/.h files, I can compile it, but the compiler dialog shows "ROM 100%". The 18F2525 source compiled to about 5k (max 48k), so I know the memory isn't full.
I'm using PCWH v4.033.
Has anyone else seen this before?
Thanks,
Neil |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 06, 2007 3:08 pm |
|
|
I made a test program that uses about 5KB of Flash and it reports the correct the correct ROM usage percentage at the top of the .LST file:
Code: |
CCS PCH C Compiler, Version 4.033, xxxxx 06-May-07 14:05
Filename: PCH_Test.lst
ROM used: 5098 bytes (16%)
Largest free fragment is 27662
RAM used: 18 (2%) at main() level
71 (7%) worst case
Stack: 3 locations
|
Here's the test program:
Code: |
#include <18F25J10.h>
#fuses HS
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#include <math.h>
//=================================
void main()
{
float a;
float b;
float result;
a = 123.456789;
b = 456.789012;
result = a + b;
result = a - b;
result = a * b;
result = a / b;
result = floor(a);
result = pow(a, b);
//result = cos(a);
//result = asin(a);
//result = atan(a);
//result = atan2(a, b);
//result = log(a);
//result = sqrt(a);
//printf("%f ", result);
while(1);
} |
|
|
|
Neil_J
Joined: 11 Jun 2006 Posts: 4
|
|
Posted: Sun May 06, 2007 3:50 pm |
|
|
Quote: | I made a test program that uses about 5KB of Flash and it reports the correct the correct ROM usage percentage at the top of the .LST file: |
PCM programmer, Do you know of a good example of compiling/linking projects in V4? I've seen your post on how to do it with V3 (i.e. with no linker), but I'd like to use the linker.
Some questions the CCS documentation doesn't address:
- Do you still #include the .c files?
- Do you have to #include the processor directives in each module? If so, which one, the .c or the .h?
- Within a module, do you have to #include .h files of neighboring modules if you want to access variables or functions from them?
Thanks again,
Neil |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun May 06, 2007 4:02 pm |
|
|
I don't want to do that. There are other regulars on here who are
testing the new features in version 4. I will defer to them. |
|
|
|