HI all, I am working on a project based on Electronic lockers using 89V51RD2 microcontroller. and keil for programming. but when i try to compile i am getting an error
*** ERROR L107: ADDRESS SPACE OVERFLOW SPACE: DATA SEGMENT: ?DT?SAS_USING_89V51RD2 LENGTH: 006BH Program Size: data=160.1 xdata=0 code=9272 Target not created
As per the datasheet of controller i am using, it contains the 1-KB of data ram and 64-KB of Flash memory. so why i am getting this error in keil while i am trying to build it... please give me an solution to this. thanks...
Time to learn about the different memory regions of a 8051 processor.
You did notice that the printout contained:
Program Size: data=160.1 xdata=0 code=9272
where data=160.1 while xdata=0, and that the error did not mention XDATA but DATA?
So please take a closer look in the datasheets how much DATA you can use and how much XDATA you can use - you can't just assume that a datasheet claiming 1kB of RAM means you have 1kB of DATA. Especially since a 8051 chip can't address 1kB of DATA without using banking.
bible time www.danlhenry.com/.../80C51_FAM_ARCH_1.pdf www.danlhenry.com/.../80C51_FAM_HARDWARE_1.pdf www.danlhenry.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Thanks all for your help... I agree that if the data sheet claims 1K of RAM does mean that it has 1K of DATA. but this is a very first line from the data sheet. The P89V51RD2 is an 80C51 microcontroller with 64 kB Flash and 1024 bytes of data RAM. it can be read clearly.. 1024 of data RAM.
The chip does not have 1kB of DATA RAM, because a 8051 chip can only address 128+128 byte of DATA RAM, unless the chip has some banking support.
Your chip has 256 bytes of DATA RAM of which 128 bytes can be directly accessed and 128 bytes only indirectly accessed. It also has 768 bytes of XDATA RAM.
Spend some time with §7.1 in the datasheet. It clearly draws a diagram of 768 bytes of "EXPANDED RAM", and also indicates that you need to use MOVX to access it, i.e. the 768 bytes are accessible as XDATA.
But you would already know this if you had spent some time looking closer at the 8051 architecture before writing your post.
Since the processor can only directly access 128 bytes of DATA, it isn't good with a printout indicating 160.1 bytes. So it's time to figure out what to store in XDATA - just that all accesses to XDATA is much more expensive so you want to store data that is seldom accessed there.
Note that "DATA" (uppercase) here is being used in the specific sense of Keil's DATA Memory Area - which is not the same thing as the generic English word, "data" (lowercase).
As already noted, you need to study the 8051 documentation about the different memory areas.
You also need to study Keil's documentation on how they have implemented it as extensions to the standard 'C' programming language:
http://www.keil.com/support/man/docs/c51/c51_le_memareas.htm
http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm