Development Support
Background Debug Mode
MC68HC912DT128A Rev 2.0
MOTOROLA
Development Support
333
7-dev
BDM Commands
The BDM command set consists of two types: hardware and firmware.
Hardware commands allow target system memory to be read or
written.Target system memory includes all memory that is accessible by
the CPU12 including EEPROM, on-chip I/O and control registers, and
external memory that is connected to the target HC12 MCU.Hardware
commands are implemented in hardware logic and do not require the
HC12 MCU to be in BDM mode for execution.The control logic watches
the CPU12 buses to find a free bus cycle to execute the command so the
background access does not disturb the running application programs. If
a free cycle is not found within 128 BCLK cycles, the CPU12 is
momentarily frozen so the control logic can steal a cycle.Commands
implemented in BDM control logic are listed in
Table 56
.
Table 56 Hardware Commands
(1)
Command
BACKGROUND
Opcode (Hex)
90
Data
None
Description
Enter background mode if firmware enabled.
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 from memory with BDM in map (may steal cycles
if external access). Must be aligned access.
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 from memory with BDM out of map (may steal
cycles if external access). Must be aligned access.
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 to memory with BDM in map (may steal cycles if
external access). Must be aligned access.
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 to memory with BDM out of map (may steal
cycles if external access). Must be aligned access.
READ_BD_BYTE
(1)
E4
16-bit address
16-bit data out
READ_BD_WORD
(1)
EC
16-bit address
16-bit data out
READ_BYTE
E0
16-bit address
16-bit data out
READ_WORD
E8
16-bit address
16-bit data out
WRITE_BD_BYTE
(1)
C4
16-bit address
16-bit data in
WRITE_BD_WORD
(1)
CC
16-bit address
16-bit data in
WRITE_BYTE
C0
16-bit address
16-bit data in
WRITE_WORD
C8
16-bit address
16-bit data in
1. Use these commands only for reading/writing to BDM locations
.
The BDM firmware ROM and BDM registers are not nor-
mally in the HC12 MCU memory map
.
Since these locations have the same addresses as some of the normal application
memory map, there needs to be a way to decide which physical locations are being accessed by the hardware BDM com-
mands
.
This gives rise to needing separate memory access commands for the BDM locations as opposed to the normal
application locations
.
In logic, this is accomplished by momentarily enabling the BDM memory resources, just for the ac-
cess cycles of the READ_BD and WRITE_BD commands
.
This logic allows the debugging system to unobtrusively access
the BDM locations even if the application program is running out of the same memory area in the normal application mem-
ory map
.