English
Language : 

MC9S12E256 Datasheet, PDF (454/602 Pages) Freescale Semiconductor, Inc – HCS12 Microcontrollers
Chapter 15 Background Debug Module (BDMV4)
When BDM is activated, the CPU finishes executing the current instruction and then begins executing the
firmware in the standard BDM firmware lookup table. When BDM is activated by the breakpoint
sub-block, the type of breakpoint used determines if BDM becomes active before or after execution of the
next instruction.
NOTE
If an attempt is made to activate BDM before being enabled, the CPU
resumes normal instruction execution after a brief delay. If BDM is not
enabled, any hardware BACKGROUND commands issued are ignored by
the BDM and the CPU is not delayed.
In active BDM, the BDM registers and standard BDM firmware lookup table are mapped to addresses
0xFF00 to 0xFFFF. BDM registers are mapped to addresses 0xFF00 to 0xFF07. The BDM uses these
registers which are readable anytime by the BDM. However, these registers are not readable by user
programs.
15.4.3 BDM Hardware Commands
Hardware commands are used to read and write target system memory locations and to enter active
background debug mode. Target system memory includes all memory that is accessible by the CPU such
as on-chip RAM, EEPROM, FLASH EEPROM, I/O and control registers, and all external memory.
Hardware commands are executed with minimal or no CPU intervention and do not require the system to
be in active BDM for execution, although they can continue to be executed in this mode. When executing
a hardware command, the BDM sub-block waits for a free CPU bus cycle so that the background access
does not disturb the running application program. If a free cycle is not found within 128 clock cycles, the
CPU is momentarily frozen so that the BDM can steal a cycle. When the BDM finds a free cycle, the
operation does not intrude on normal CPU operation provided that it can be completed in a single cycle.
However, if an operation requires multiple cycles the CPU is frozen until the operation is complete, even
though the BDM found a free cycle.
The BDM hardware commands are listed in Table 15-5.
Table 15-5. Hardware Commands
Command
BACKGROUND
ACK_ENABLE
ACK_DISABLE
READ_BD_BYTE
READ_BD_WORD
READ_BYTE
Opcode
(hex)
90
D5
D6
E4
EC
E0
Data
Description
None
Enter background mode if firmware is enabled. If enabled, an ACK will
be issued when the part enters active background mode.
None
Enable handshake. Issues an ACK pulse after the command is
executed.
None
Disable handshake. This command does not issue an ACK pulse.
16-bit address Read from memory with standard BDM firmware lookup table in map.
16-bit data out Odd address data on low byte; even address data on high byte.
16-bit address Read from memory with standard BDM firmware lookup table in map.
16-bit data out Must be aligned access.
16-bit address Read from memory with standard BDM firmware lookup table out of
16-bit data out map. Odd address data on low byte; even address data on high byte.
MC9S12E256 Data Sheet, Rev. 1.08
454
Freescale Semiconductor