Development Support
Technical Data MC68HC912DG128 — Rev 3.0
Development Support
The second type of BDM comm ands ar e firmware commands
implemented in a small ROM within the HC12 MCU. The CPU must be
in back gr ou nd mo de to exec ute fir mwa re com m an ds. Th e u sual way to
get to background mode is by the hardware command BACKGROUND.
The BDM ROM is located at $FF20 to $FFFF while BDM is active. There
are also seven by tes of BDM registe rs located a t $FF00 to $ FF06 when
BDM is active. The CPU exec utes code in the BDM firm ware to perfor m
the requested operation. The BDM firmware watc hes for serial
commands and executes them as they are received. The firmware
commands are shown in Table 18-3.
Table 18-2. Hardware Commands(1)
Command Opcode (Hex) Data Description
BACKGROUND 90 None Enter background mode if firmware enabled.
READ_BD_BYTE(1) E4 16-bit address
16-bit data out
Read from memory with BDM in map (may steal
cycles if external access) data for odd address on
low byte, data for even address on high byte.
READ_BD_WORD(1) EC 16-bit address
16-bit data out Read from memory with BDM in map (may steal
cycles if external access). Must be aligned access.
READ_BYTE E0 16-bit address
16-bit data out
Read from memory with BDM out of map (may steal
cycles if external access) data for odd address on
low byte, data for even address on high byte.
READ_WORD E8 16-bit address
16-bit data out Read from memory with BDM out of map (may steal
cycles if external access). Must be aligned access.
WRITE_BD_BYTE(1) C4 16-bit address
16-bit data in
Write to memory with BDM in map (may steal cycles
if external access) data for odd address on low byte,
data for even address on high byte.
WRITE_BD_WORD(1) CC 16-bit address
16-bit data in Write to memory with BDM in map (may steal cycles
if external access). Must be aligned access.
WRITE_BYTE C0 16-bit address
16-bit data in
Write to memory with BDM out of map (may steal
cycles if external access) data for odd address on
low byte, data for even address on high byte.
WRITE_WORD C8 16-bit address
16-bit data in Write to memory with BDM out of map (may steal
cycles if external access). Must be aligned access.
1. Use these commands only for reading/writing to BDM locations
.
The BDM firmware ROM and BDM registers are not normally
in the HC12 MCU memory map
.
Since these location s have the same addres ses as som e of the normal application memory
map, there needs to be a way to decide which physica l locations are being accessed by the hardw are BDM commands
.
This
gives rise to needing separate memory access commands for the BDM locations as opposed to the normal application lo-
cations
.
In logic, this is accomp lished by momentarily enabling the BDM memory resources, just for the access cy cles of the
READ_BD and W R ITE_BD com m and s
.
This logic allows the debugging system to unobtrusively access the BD M locations
even if the application program is running out of the same memory area in the normal application memory map
.
Freescale Semiconductor, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...