CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

memory insufficient

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dirak
Guest







memory insufficient
PostPosted: Tue Mar 02, 2010 3:50 pm     Reply with quote

Dear all,

I have run into insufficient memory problem for PIC 18F87J50. I am using CCS compiler version 4.076 in MPLAB IDE 8.30.

The problem seems to be due to CCS compiler not using a memory chunk between the ranges 0x600 and 0xF00. I didn't use any reserve keyword to reserve memory. Please let me know what I can do to overcome this issue. Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 02, 2010 4:08 pm     Reply with quote

Do you have the full IDE compiler (PCWH or PCWHD) ?
If so, you can use the Device Editor to examine the device data.
See if it has the correct memory size entered. Sometimes when
CCS adds support for a new PIC, they don't check the details enough.
If the memory size has been entered incorrectly, then edit the device
data for the 18F87J50 and save it. That will probably fix it.

Look in the 18F87J50 data sheet to see the correct memory size.
dirak85
Guest







PostPosted: Tue Mar 02, 2010 5:25 pm     Reply with quote

Thanks PCM programmer.

By memory do you mean the programming memory or data memory? I checked that the program memory is given correctly. My problem is with the data memory. I am getting the error " Not enough memory for all the variables" and as I see a chunk of memory is not being used. My program was working fine in the past.

The only change that happened was CCS software update (CCS download manager update-not the compiler.) today. I reinstalled my compiler, but still the problem persists. Please let me know of any available solutions to this.

Thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 02, 2010 5:40 pm     Reply with quote

I mean the RAM.

Do you have the full IDE version of the compiler ?
If you do, look at this screenshot of the Device Editor. Down at the
bottom, you can see an area where they enter a checkmark if a
256-byte RAM bank exists.
http://www.ccsinfo.com/images/content/device_editor.gif

If the have the IDE, then look the Device Editor page for your PIC.
See if CCS has entered the correct number of RAM banks.
If not, fix it.
dirak85
Guest







PostPosted: Tue Mar 02, 2010 7:53 pm     Reply with quote

I checked the memory (mine is PCWH). It's fine. based on the datasheet this processor has 16 banks.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Tue Mar 02, 2010 8:32 pm     Reply with quote

I installed version 4.076 and everything is normal. No gaps in the memory.
The devices.dat file is also normal.

I compiled a program with a 3000 byte buffer defined in RAM and the
statistics show 76% of RAM used.
_________________
Google and Forum Search are some of your best tools!!!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 02, 2010 8:38 pm     Reply with quote

I installed vs. 4.076 and compiled the test program shown below.
I blocked off access to most RAM below address 0x600 with a #reserve
statement. Then I declared an array and two variables. The .SYM file
shows that the RAM in the range of 0x600 and above is used by the
compiler. I don't see a problem.

From the .LST file:
Code:

000     @SCRATCH
001     @SCRATCH
001     _RETURN_
002     @SCRATCH
003     @SCRATCH
004     @SCRATCH
600-631 array
632-633 temp
634-637 value

Here's the test program:
Code:

#include <18F87J50.h>
#fuses HS,NOWDT 
#use delay(clock=20000000)

#reserve 0x005:0x5FF

int8 array[50];
int16 temp;
int32 value;

//======================================
void main(void)
{


while(1);
}
dirak85
Guest







PostPosted: Wed Mar 03, 2010 7:17 am     Reply with quote

The program you gave here worked fine for me. But mine still gives the same error. Crying or Very sad
DIRAK85
Guest







PostPosted: Wed Mar 03, 2010 7:28 am     Reply with quote

My memory is not being used in the range 0x5c8-0xf00 as seen in the .sym file. I tried #reserve in my code to reserve memory starting from 0x400 to 0x500, but this seems to have no effect. The .sym file still shows the same kind of memory allocation after I compile my code again and gives memory insufficient error.
dirak85
Guest







PostPosted: Wed Mar 03, 2010 8:07 am     Reply with quote

I tried #reserve at a different memory chunk 0x100: 0x300. This does make the memory in this range disappear. But it does not affect when I try to reserve anywhere between 0x400: 0xf00, i.e. when the # reserve command overlaps any memory inthe range 0x5c8 and 0xfff it's ineffective (just to remind my problem is with memory 0x5c8-oxf00 not being used by compiler). The only other # reserve used in the code are in usb.h file provided by CCS which for my processor reserves a memory location of 0x400:0x4ff. Please let me know of any other solution.
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Mar 03, 2010 9:22 am     Reply with quote

There is apparently something in your code doing this since you say you tried
the program by PCM and it works OK. You will need to post your code to be
able to help any further.
_________________
Google and Forum Search are some of your best tools!!!!
dirak85
Guest







PostPosted: Wed Mar 03, 2010 11:12 am     Reply with quote

The following code doesn't give the same error. I think the problem is related to usb_cdc.h. Not sure if this is some bug in CCS compiler. I am trying to get the newer version of compiler and will post the results.
Code:

 #include <18F87J50.h>

#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)

#include <usb_cdc.h>

int8 array[200];
int8 array7[400];
int8 arry6[800];
int8 arrat[900];
int16 temp;
int32 value;

//======================================
void main(void)
{


while(1);
}
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed Mar 03, 2010 12:20 pm     Reply with quote

I can confirm that the problem does appear in version 4.076 and it is being
caused by something in the USB files.

Versions 4.103 and 4.105 compile with no problems and no lost RAM.

Comparing the usb_cdc.h file between the old and new versions there are a
lot of differences. One of them is a series of #locates in the old version that
don't appear to be in the newer version.
_________________
Google and Forum Search are some of your best tools!!!!
dirak85
Guest







PostPosted: Wed Mar 03, 2010 5:03 pm     Reply with quote

Thanks for all your quick responses. I confirm dyeatman's post. Updating my compiler to a newer version solves my problem. It's a bug in CCS compiler's files. Thanks again.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group