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 support@ccsinfo.com

#zero_ram causing Out of ROM error

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



Joined: 18 Jul 2006
Posts: 94

View user's profile Send private message

#zero_ram causing Out of ROM error
PostPosted: Tue May 07, 2019 11:02 am     Reply with quote

I am using a PIC16F1518 with PCM version V4.140
My program compiles properly until I add #zero_ram right before the main program.

Code:
#zero_ram
void main()
{


When I add this I get the following error.

"Out of ROM, A segment or the program is too large MAIN"

If I remove #zero_ram and compile it again it compiles fine.

Any thoughts?

Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Tue May 07, 2019 11:04 am     Reply with quote

It does involve quite a large piece of code. Why do you want it?.
Just make sure you initialise all variables that must be initialised.
edbfmi1



Joined: 18 Jul 2006
Posts: 94

View user's profile Send private message

PostPosted: Tue May 07, 2019 11:30 am     Reply with quote

Thanks for the quick reply.

I just wanted to make sure everything was cleared because I am getting a random error. I guess I was just being lazy. I will go through and make sure I didn't miss a variable.

Thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19195

View user's profile Send private message

PostPosted: Tue May 07, 2019 12:41 pm     Reply with quote

Because the RAM is several small pages, the code to clear it is quite
bulky on the PIC16's.
Once the code is running, the RAM contents will all depend on your code.
Won't change, so unlikely to cause a random error.
Look carefully at anything using pointers.
Array accesses etc..
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