We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi
i am using P89V51RD2FN device and it has 64KB code flash memory.and use MIKROC compiler. my program is of 30KB when i compile it gives error of not enough RAM so i want to move my whole program in code flash memory but problem is that i don't no how address flash memory? if any one have solution please help me
As far as I know, your program should already be in flash memory. If you don't have enough RAM, maybe you use some big data structures which are in RAM, but which can be in flash. If you have local variable
int array[128];
it needs 512bytes RAM. You can move it in flash using the 'const' qualifier.
const int array[128] = {...};
Of course, if it is const, you should initialize it and you cannot modify array's values at runtime.
"[...] it needs 512bytes RAM." This would require that the used compiler has a four-byte integer. For a 8051 chip, it's more likely that the compiler vendor decided on a two-byte integer.
You're right. I made wrong assumption. I should have searched for more information about the uC before posting.