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

Problems using all the RAM on PIC18F87J11

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



Joined: 12 Dec 2007
Posts: 2

View user's profile Send private message

Problems using all the RAM on PIC18F87J11
PostPosted: Thu Dec 13, 2007 10:44 am     Reply with quote

On my PIC18F87J11 platform I can only use approximately half of the available ram. Any time I go over 50% for any reason, my application will stop running shortly after reset. Resize any of my buffers so that the RAM usage goes down, and all my problems go away. Am I missing something? PCH 4.062
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Dec 13, 2007 2:38 pm     Reply with quote

Do an experiment. Compile two versions of the code. Make one
version that works. Then increase the size of one of the arrays by
one byte, and verify that the program now fails. Now compare the
symbol tables (in the .SYM files) for each version. Check if the
compiler is allocating the same RAM address for two different variables
when it should not being doing this. Check to see if the bad program
uses some illegal RAM addresses.

Note: The compiler will re-use the RAM for local variables in a function,
because once you return from that function, the local variables are
considered to be destroyed anyway. So, expect to see that in the .SYM
file. But I'm suggesting that you should look for other problems in the
.SYM file, such as the re-use of RAM addresses for variables that are
declared in both main() and an interrupt service routine.

Also look for coding errors, where you write past the end of an array.
Some people forget that a string requires an additional byte at the end,
for the 0x00 byte that terminates the string.

Also, if you have the full CCS IDE, which comes with the Device Editor,
I suggest that you check the device data screen for your PIC. Make sure
that the RAM addresses that have been entered into the Device Data
are correct, according the PIC's data sheet.
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