Hi every one,
The Philips 87C51MX user's manual indicated that the on-chip EDATA ranges from 0x100 to 0xffff; which followed the IDATA.
An article found in the Keil support knowledge base (CX51: LOCATING CODE IN PHILIPS MX INTERNAL CODE MEMORY) showed the following:
EDATA (0x7F0000-0x7F04FF), /*on-chip RAM */
HCONST (0x810000-0x84FFFF) /*off-chip Flash for 'const far' */
How does the "0x7f0000" become the starting address of on-chip EDATA? And where would the on-chip XDATA start?
EDATA is one of the many names for "on chip xdata"
OK. If that's the case, can I declare all my on-chip variables to be XDATA and make use of all 3072 bytes of the 51MC2 internal RAM?
Why is the on-chip XDATA starting from a high address like 0x7F0000, and not 0x0000?
Did Philips define the address ranges for each type of data in their 51MX derivertives?
Thanks for your response.
The 51MX has a lot of addressing modes (since it is an extension to the 8051). Many of these are the standard 8051 addressing modes.
There are some new modes, however, that require more bytes to encode. These are less-efficient if you only need access to a 256-byte or 64K-byte range (like DATA or XDATA). The benefit of the new addressing modes is that the allow access to the entire 24-bit address space.
The MX takes the 8051 harvard architecture (which is 128 bytes of SFR + 128 bytes of DATA/256 bytes of IDATA + 64K of XDATA + 64K of CODE) and "maps" it into a 16MB linear address space.
This is what's causing so much confustion.
You can think of the address space as follows:
00:0000h-7F:FFFFh - HDATA (8 MB)
00:0000h-00:FFFFh - XDATA (64K - same as 8051)
7F:0000h-7F:FFFFh - EDATA (64K)
7F:0000h-7F:007Fh - DATA (128 bytes - same as 8051)
7F:0000h-7F:00FFh - IDATA (256 bytes - same as 8051)
80:0000h-FF:FFFFh - ECODE (8 MB)
80:0000h-80:FFFFh - CODE (64K - same as 8051)
Re: edata in 51MX.
In the evaluation version (EK51v701) I tried to add "edata" to its main.c file. But the keyword "edata" would not come up blue and bold (other keywords like "data", "idata" or "xdata" would); meaning I can't declare an "edata" this way.
But the map file, there's a section that showed the EDATA section is defined.
Any one has successfully used 51MX's on-chip edata? How is creating an "edata" variable done?
Thanks for your help.
Use the far keyword for variables located in EDATA. Use far const for constants located in ECODE.
There should be examples of this in the examples folder.
This is also discussed in the manual.
I used the "far" keyword, trying to create an on-chip edata variable.
But in the map file, the variables declared with "far" turned out to be HDATA, and is not "located" at where the EDATA should be.
What syntax will give me a report in the map file that says: EDATA ..... my_var. ?
It seems to get much more difficult than it should.
When it's listed as HDATA in the map file, can I think of it as EDATA?
Take a look to:
This is the direct answer to your problem.
View all questions in Keil forum