
Internal Resource Mapping
MC68HC812A4 Data Sheet, Rev. 7
Freescale Semiconductor
57
commands can be executed while the CPU is operating normally. Other BDM commands are firmware
based and require the BDM firmware to be enabled and active for execution.
In special single-chip mode, BDM is enabled and active immediately out of reset. BDM is available in all
other operating modes, but must be enabled before it can be activated. BDM should not be used in special
peripheral mode because of potential bus conflicts.
Once enabled, background mode can be made active by a serial command sent via the BKGD pin or
execution of a CPU12 BGND instruction. While background mode is active, the CPU can interpret special
debugging commands, and read and write CPU registers, peripheral registers, and locations in memory.
While BDM is active, the CPU executes code located in a small on-chip ROM mapped to addresses
$FF20 to $FFFF, and BDM control registers are accessible at addresses $FF00 to $FF06. The BDM ROM
replaces the regular system vectors while BDM is active. While BDM is active, the user memory from
$FF00 to $FFFF is not in the map except through serial BDM commands.
5.3 Internal Resource Mapping
The internal register block, RAM, and EEPROM have default locations within the 64-Kbyte standard
address space but may be reassigned to other locations during program execution by setting bits in
mapping registers INITRG, INITRM, and INITEE. During normal operating modes, these registers can be
written once. It is advisable to explicitly establish these resource locations during the initialization phase
of program execution, even if default values are chosen, to protect the registers from inadvertent
modification later.
Writes to the mapping registers go into effect between the cycle that follows the write and the cycle after
that. To assure that there are no unintended operations, a write to one of these registers should be
followed with a NOP (no operation) instruction.
If conflicts occur when mapping resources, the register block takes precedence over the other resources;
RAM or EEPROM addresses occupied by the register block are not available for storage. When active,
BDM ROM takes precedence over other resources although a conflict between BDM ROM and register
space is not possible.
Table 5-2
shows resource mapping precedence.
All address space not used by internal resources is external memory by default.
The memory expansion module manages three memory overlay windows:
1.
Program
2.
Data
3.
One extra page overlay
The sizes and locations of the program and data overlay windows are fixed. One of two locations can be
selected for the extra page (EPAGE).
Table 5-2. Mapping Precedence
Precedence
1
2
3
4
5
Resource
BDM ROM (if active)
Register space
RAM
EEPROM
External memory