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

Out of memory - Using 12-Bit part (16C57)

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







Out of memory - Using 12-Bit part (16C57)
PostPosted: Thu Jul 13, 2006 2:53 pm     Reply with quote

I see where this question has been answered a 1000 times for 14 bit parts using the #device *=16 command. My problem is I am using a PIC16C57 and it is a 12bit part. What can I do to let the compiler use the extra three pages of memory?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 13, 2006 3:05 pm     Reply with quote

That device statement affects RAM usage. Your question is about ROM.
Page sizes on the 16C57 are relatively small -- they're only 512 bytes.
Compare this to 2KB pages on the 16F877. In CCS, a function must
fit within a ROM page. It can't span 2 or more pages. So one possible
reason for "out of ROM" is that a function is too large. You need to
reduce the size. Split it up into two or more functions. Also, avoid
using floating point with such a small PIC.
Ttelmah
Guest







PostPosted: Thu Jul 13, 2006 3:20 pm     Reply with quote

#device *=8

Your chip, only supports 72 bytes of RAM, so only needs a 8 bit address, .
So:
Code:

#include <16C57>
#device *=8

void main() {
   int array[16];
   int array2[16];
   int array3[16];
   int test,test1,test2;
   //Rest of code here

}

Will fit array2, and array3, into the higher banks.
Rmember that you will be 'stuck' with the largest possible element in the higher banks, being 16 bytes.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 13, 2006 4:12 pm     Reply with quote

Sorry. As soon as I saw the "three pages", I immediately jumped on
it as a ROM issue.
Ttelmah
Guest







PostPosted: Fri Jul 14, 2006 3:56 am     Reply with quote

Like me, - only 'human' (or near at least...)... Smile
It is an oddity really, that the 12 parts default to using a 5bit RAM address, while the 16 parts default to a 8bit address. Relatively poorly documented.

Best Wishes
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