Ameya Hardikar

STACK Overflow problem in QD4

Discussion created by Ameya Hardikar on Mar 29, 2009
Latest reply on Apr 2, 2009 by bigmac
Dear All,

I am using QD4 device for universal IR receiver project. I have allocated 150 bytes of RAM(array of unions..each having size of one int) to save incoming waveform. Initially it was giving 'out of space allocation' error. But i made some changes to project.prm file by changing some allocation for Z_RAM and it didn't give any error. My 'project.prm' file is attached below.

SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */    ROM                      =  READ_ONLY    0xF000 TO 0xFFAD;//4k(65453-61440)    Z_RAM                    =  READ_WRITE   0x0060 TO 0x0080;//32(128-96)    RAM                      =  READ_WRITE   0x081 TO 0x015F;//222(129 to 351)    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFCF;//ENDPLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */    DEFAULT_RAM                         INTO  RAM;    DEFAULT_ROM, ROM_VAR, STRINGS       INTO  ROM; /* ROM1 In case you want to use ROM1 as well, be sure the option -OnB=b is passed to the compiler. */    _DATA_ZEROPAGE, MY_ZEROPAGE         INTO  Z_RAM;END//STACKSIZE 54STACKSIZE 60


Now my problem is, my code only works some time;otherwise it always fails to execute. I think this large allocation of RAM might be resulting in overflow of STACK. I don't have any alternative to avoid this allocation. Can anybody please tell me how much space i have to leave for Z_RAM? Is there any alternative to relocate stack;so that i can continue with current allocation space?  Please Help..