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.
Hello
I got the DTMF tone generator example from http://www.keil.com/download/docs/234.asp and it works great, however when I integrate the routines into another program I get a compiliation error :
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: ?DT?MAIN LENGTH: 001CH
I'm trying to figure out what would be using so much RAM. I see the code is using a lot of struct's, are those stored in RAM?
I've looked at the M51 file I just don't understand why it would run out of space in the MAIN segment, there isn't a lot of code in there
thanx!
Xarion
I'm trying to figure out what would be using so much RAM. I see the code is using a lot of struct's, are those stored in RAM? yes, unless they are preceeded by e.g 'code'
the manual, sorry, let you know which keywords to preceede declarations and definitions with.
Erik
"I'm trying to figure out what would be using so much (sic?) RAM."
You do realise that the DATA space in the 8051 architecture is only 128 bytes - so it really isn't much at all!
"I see the code is using a lot of struct's, are those stored in RAM?"
Whether they are structs or not has no effect on where they are stored.
You can specify where individual items are stored: http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm
You can also adjust the default: http://www.keil.com/support/man/docs/c51/c51_le_memmodels.htm
Note that accessing XDATA is slower, abd takes more code...
"I've looked at the M51 file I just don't understand why it would run out of space in the MAIN segment, there isn't a lot of code in there"
The size of the code has no direct relation to the size of the data!
I just don't understand why it would run out of space in the MAIN segment, there isn't a lot of code in there"
the '51 is a HARVARD architecture
Strictly, it has a modified Harvard architecture:
" ... a variation of the Harvard computer architecture that allows the contents of the instruction memory to be accessed as if it were data. Most modern computers that are documented as Harvard Architecture are, in fact, Modified Harvard Architecture."
en.wikipedia.org/.../Modified_Harvard_architecture
Note also that the 8051 doesn't just have separate code and data spaces - it also has several distinct data spaces. Again, see: http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm
For the basics of the 8051 architecture, see: www.8052.com/.../120112 and: http://www.8052.com/tut8051
You are asking how you wrote you code? Variables are in RAM that is why they are variable. If it is fixed data (struct or not) you can instruct the compiler to put them in ROM.