Keil Logo Arm Logo

Large memory model

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Sam Shaw
Posted
22-Feb-2005 06:08 GMT
Toolset
C51
New! Large memory model
I have a program which works fine in small memory model. The program is growing beyond the 2K boundary and I want to switch to the Large model. When I switch to large model, the program stops working. I also tried it with a working code which is less than 2K. The only thing I do is set the memory model to large 64K code. Am I supposed to do anyting else?
Thanks.
-sam
Read-Only
Author
saied benyamin
Posted
22-Feb-2005 06:49 GMT
Toolset
C51
New! RE: Large memory model
I forgot to mention that it works with the epm900 emulator, but once I burn a part (philips lpc932) using the mcb900, the part does not work.
Thanks
-sam
Read-Only
Author
Stefan Duncanson
Posted
22-Feb-2005 10:22 GMT
Toolset
C51
New! RE: Large memory model
You don't need to change the memory model as all this affects is the default memory space used for variables. Generally speaking you should always use the small model.

You do need to change the 'code ROM size', however.

I suspect the reason your code no longer works is because you have changed the memory model and your variables are now being located in non-existent external RAM.
Read-Only
Author
erik malund
Posted
22-Feb-2005 14:00 GMT
Toolset
C51
New! RE: Large memory model
if you are using the eval version, you may get in trouble since the eval is limited in code size and location.

Also using the LARGE model with a derivatives as small as the LPC does not make sense, why are you even attempting it?

Erik
Read-Only
Author
Saied Benyamin
Posted
22-Feb-2005 18:19 GMT
Toolset
C51
New! RE: Large memory model
My code is larger than 2K. It is going to be close to 4K. The eval is supposed to be good up to 4K. What are my options?
Thanks.
Read-Only
Author
Saied Benyamin
Posted
22-Feb-2005 18:21 GMT
Toolset
C51
New! RE: Large memory model
Thanks Steffen, I will try this. I thought that if the code is larger than 2K, I can not use small model.
Read-Only
Author
Neil Kurzman
Posted
23-Feb-2005 07:00 GMT
Toolset
C51
New! RE: Large memory model
Or leave the model as small an break it up into 2 or more C modules.
Read-Only
Author
Neil Kurzman
Posted
23-Feb-2005 07:03 GMT
Toolset
C51
New! RE: Large memory model
Or leave the model as small an break it up into 2 or more C modules.
Read-Only
Author
Stefan Duncanson
Posted
23-Feb-2005 09:40 GMT
Toolset
C51
New! RE: Large memory model
"Or leave the model as small an break it up into 2 or more C modules."

How would that help?
Read-Only
Author
Saied Benyamin
Posted
23-Feb-2005 18:44 GMT
Toolset
C51
New! RE: Large memory model
It is many modules, however, the modules have to call each other and can not cross the 2K boundary as steffan is pointing out.
Read-Only
Author
erik malund
Posted
23-Feb-2005 20:28 GMT
Toolset
C51
New! RE: Large memory model
can not cross the 2K boundary


Never heard of that one, I have modules that are >8k. Are you using assembler and AJMP?.

Erik
Read-Only
Author
Saied Benyamin
Posted
23-Feb-2005 22:27 GMT
Toolset
C51
New! RE: Large memory model
My programs are in C.
I thought that if one is using small memory model, the entire code has to fit within a 2K code segment. This is so that the jump instructions can use 16 bit instructions. Once the code gets larger than 2K, the linker starts giving errors.
Read-Only
Author
Andrew Neil
Posted
23-Feb-2005 23:24 GMT
Toolset
C51
New! RE: Large memory model
"I thought..."

Never mind what you thought - look it up in the Manual and be certain!

Note that there are both Code and Data size options to consider.

Code Size - SMALL, COMPACT, LARGE, D512K, D16M:
http://www.keil.com/support/man/docs/c51/c51_rom.htm

Data Size = Memory Model - Small, Compact, Large:
http://www.keil.com/support/man/docs/c51/c51_small.htm
http://www.keil.com/support/man/docs/c51/c51_compact.htm
http://www.keil.com/support/man/docs/c51/c51_large.htm
Read-Only
Author
Saied Benyamin
Posted
23-Feb-2005 23:29 GMT
Toolset
C51
New! RE: Large memory model
Problem solved. My bad, confusing memory model with code size. Thanks Andrew, I realy appreciate your help.
-saied
Read-Only
Author
erik malund
Posted
24-Feb-2005 16:01 GMT
Toolset
C51
New! RE: Large memory model
My bad, confusing memory model with code size.
that, still, does not make sense. How can a 8k LPC932 be "LARGE"

Erik
Read-Only
Author
Andrew Neil
Posted
24-Feb-2005 16:23 GMT
Toolset
C51
New! RE: Large memory model
"How can a 8k LPC932 be 'LARGE'"
It may not be LARGE, but it is bigger than SMALL and may have functions too big for COMPACT...

http://www.keil.com/support/man/docs/c51/c51_rom.htm
Read-Only
Author
erik malund
Posted
24-Feb-2005 16:32 GMT
Toolset
C51
New! RE: Large memory model
"LARGE" does not make sense, "ROM LARGE" might. And he does post "memory model"

The 932 has about the same amount of RAM and XRAM, thus memory model LARGE does not make sense.

Erik
Read-Only
Author
Stefan Duncanson
Posted
24-Feb-2005 16:56 GMT
Toolset
C51
New! RE: Large memory model
""LARGE" does not make sense, "ROM LARGE" might. And he does post "memory model""

Yes, and then he posted:

"Problem solved. My bad, confusing memory model with code size. Thanks"

Please read the thread carefully from the beginning.
Read-Only
Author
erik malund
Posted
24-Feb-2005 16:59 GMT
Toolset
C51
New! RE: Large memory model
OH, missed that.
Read-Only
Author
Saied Benyamin
Posted
24-Feb-2005 18:46 GMT
Toolset
C51
New! RE: Large memory model
Sorry for all the confusion. I was setting memory model to large in order to use more than 2K of ROM. However, this affects the ram size as well and tries to use non-existent ram (external ram). So the program would work on the emulator and not when I burned a chip. I guess the emulator has the external RAM. Instead I need to set the ROM size to either compact or large and leave memory model as small.
I realy appreciate everyone's help.
-sam

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.