View previous topic :: View next topic |
Author |
Message |
seegoon
Joined: 19 Jan 2005 Posts: 8
|
weird compiled code question |
Posted: Tue Jan 25, 2005 12:48 am |
|
|
Hi to all.
I am seeing something weird in my program memory after I compile my code. After I have compiled my C code , if I look at the compiled code in the View - Program Memory in Mplab I see something strange.
The program memory if filled from 0 to about 0589 with normal code. Then from 058a to 07FF is 0x3fff(blank) and the code then carries on untill
0CFF normally. The code runs with no problem , I am just wondering about this "Gap" in the program memory.
I seems to be caused by using the printf function when printing a floating point number to the lcd. eg : printf(lcd_putc,"%3.1F ",maxlogtemp / conversion_factor);
If I don't print any floats the code compiles in one continous block.
Any Ideas.
Cheers
Rob |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 25, 2005 1:11 am |
|
|
The reason is that your PIC has two or more ROM pages, each being
0x800 words in length. The compiler will not locate a function so that it
spans a ROM page boundary. Each function must fit entirely within a
page. Functions that use floating point tend to be large, so apparently
the compiler couldn't fit your function into the remaining space in the
1st page, so it moved to the 2nd page. |
|
|
seegoon
Joined: 19 Jan 2005 Posts: 8
|
|
Posted: Tue Jan 25, 2005 1:20 am |
|
|
Makes sense.
Thanks
Rob. |
|
|
|