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: 19496
Posted: Tue May 07, 2019 11:04 am
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: 103
Posted: Tue May 07, 2019 11:30 am
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: 19496
Posted: Tue May 07, 2019 12:41 pm
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..
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