View previous topic :: View next topic |
Author |
Message |
ss1903
Joined: 21 Sep 2007 Posts: 2
|
out of rom? |
Posted: Fri Sep 21, 2007 2:46 am |
|
|
hi
i have a problem with 16f877A -8K word flash memory.
in my code, i got out of rom error while it used only about %42 of rom.
so i wrote a simple code how much i could use all of the rom.
#include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
float a=999999;
float b=1.1;
void main()
{
a=a/b;
a=a/b;
a=a/b;
.
.
.
.
a=a/b;
}
the number of a=a/b is 75 and rom usage is %27.
after I added a=a/b
and i got out or rom error.
do you have an idea how can i achieve this problem? |
|
|
Guest
|
|
Posted: Fri Sep 21, 2007 2:53 am |
|
|
How about searching the forum, before asking?...
Or even reading the manual?...
You are not running out of ROM as such, but running out of space in one 'segment'. A search on the forum, will find a full description, as well as what you can do about it. It is also detailed in the compiler manual.
Best Wishes |
|
|
ss1903
Joined: 21 Sep 2007 Posts: 2
|
|
Posted: Fri Sep 21, 2007 4:12 am |
|
|
dear guest
thank for reply.
i examined compiler manual and it say you must use #separete before function. but in this code i didnt use function. there is only divison. i think this divison is built in function. so how can i use #separete in this state.
i've been searching the forum but yet i cant find the solution. |
|
|
Ttelmah Guest
|
|
Posted: Fri Sep 21, 2007 7:10 am |
|
|
You have to split your code up....
Best Wishes |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
|
|