View previous topic :: View next topic |
Author |
Message |
ccmcca
Joined: 08 Oct 2005 Posts: 13
|
Out of ROM, A segment or the program is too large |
Posted: Sat Mar 11, 2006 5:34 pm |
|
|
How can i fix this problem? I cant compile the program because of this ERROR
#int_COMP
COMP_isr()
{
printf("%03.2f\r\n ",2.19-(get_timer1())*0.4*0.00034);
} |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 11, 2006 11:18 pm |
|
|
I suspect that you're using a small PIC that has a very limited amount
of ROM, or that has small ROM pages. The problem is likely caused
by your use of floating point math, which requires a lot of ROM.
Post the PIC that you're using and also the version of your compiler. |
|
|
Guest
|
16f627 |
Posted: Sun Mar 12, 2006 12:32 pm |
|
|
I am using this PIC what you suggest?
In that number of I/O PORTS...
Thanks.- |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Mar 12, 2006 12:56 pm |
|
|
I put your isr into a test program and it uses 93% of ROM with PCM vs.
3.245. The amount of ROM used is given at the top of the .LST file,
which is in your project folder.
The easiest way to get more ROM in a compatible pinout would be
to go to the 16F628. That would give you 2K ROM instead of only 1K.
However, if insist upon using floating point, you will quickly use up that
extra ROM. If you want to use floating point, you should redesign your
circuit to use a PIC that has 8K ROM at least.
Code: | #include <16F627.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, ERRORS)
#int_COMP
COMP_isr()
{
printf("%03.2f\r\n ",2.19-(get_timer1())*0.4*0.00034);
}
//===============================
void main()
{
while(1);
} |
|
|
|
Guest
|
|
Posted: Sun Mar 12, 2006 3:14 pm |
|
|
ThankS!!!!! |
|
|
|