
This document information is the intellectual property of Megawin Technology Co., Ltd.
27
Megawin Technology Co., Ltd. 2014 All right reserved.
MEGAWIN
MAKE YOU WIN
8051 OCD ICE
User Manual, v3.00
7 Special Notes
7.1 Register Definition Files
Register definition files
REG_MPC82G516.INC
and
REG_MPC82G516.H
define all Special Function Registers
(SFRs) and bit-addressable control/status bits. They are installed into the default search path used by the Keil
8051 IDE software when you do the Software Setup (described in
Section 2
). Therefore, when using the Keil
8051 tools, you can include them by
$INCLUDE (REG_MPC82G516.INC)
and
#include <REG_MPC82G516.H>
.
It is not necessary to copy a register definition file to each
project’s file directory.
7.2 On-chip XRAM and External Data Memory
Megawin 8051 devices provide on-chip XRAM (eXpanded RAM), which is accessed with the same instructions
as the traditional external data memory. The size of on-chip XRAM in MPC82G516 is 1024 bytes with addresses
0x0000 to 0x03FF. That is, the address space of on-chip XRAM overlaps that of the external data memory. So,
there must be a control bit used to distinguish these two physical memories during access. The ERAM bit (bit-1 in
register AUXR) plays this role.
Because the C51 Compiler won
’t take care which physical memory the user wants
to access, the user must manually clear this bit before accessing on-chip XRAM and set this bit before accessing
external data memory
. By default, this control bit is
‘0’ after powered on or chip reset for on-chip XRAM accessing.
The C51 Compiler offers two different memory types that access external data:
xdata
and
pdata
. (The
xdata
memory specifier refers to any location in the 64K-byte address space of external data memory. The
pdata
memory type specifier refers to only one page or 256 bytes of external data memory.) When the user want to
view the variables declared by
xdata
or
pdata
directly in the Memory Window rather than in the Watch Window,
he should select
“
Display xdata from on-chip XRAM
” or “
Display xdata from external RAM
” under menu
Peripherals- XRAM
, as shown in the following figure.