MPLAB C18 Problem

Status
Not open for further replies.

micr0man

Member
hello everyone,

I am having a unique problem with my C18 compiler. For unexplained reasons compiling a really simple program over half my data memory is used. Below is a snapshot of the problem:


as you can see the very simple program is using 268 bytes of data ram without even any bytes defined.

I am using a PIC18F4220 with MPLAB v8.66. The C18 compiler is the most recent free version of the microchip. I can zip the whole project if you wish or submit individual files.

I hope you can help me with this problem and any help is appreciated,

Dave

Edit: Sorry about the size problem. is there any way to reduce the picture size?
 

Attachments

  • lots of RAM.png
    150.4 KB · Views: 1,319
Last edited:
Check out the linker file ....MCC18\lkr\18f4220.lkr

You will see that 0x0100 bytes (256 decimal) is reserved for the C18 stack.

Your program only "uses" 12 bytes.

Hope this helps
 
Last edited:
thank you very much. your help is greatly appreciated.

Is there a way to lower this or is it set permanently?
 
Is there a way to lower this or is it set permanently?

To change stack size you can-

1 edit ....MCC18\lkr\18f4220.lkr

or

2 copy the .lkr file to your project directory, add it to your project, then edit it.

or

3 leave everything as it is. When your program gets bigger, C18 might need the stack space
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…