AN2497 Freescale Semiconductor / Motorola, AN2497 Datasheet - Page 2

no-image

AN2497

Manufacturer Part Number
AN2497
Description
HCS08 Background Debug Mode versus HC08 Monitor Mode
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2497/D
Differences Between HC08 Monitor Mode and HCS08 BDM
2
HCS08 Background Debug Mode versus HC08 Monitor Mode
The HC08 Family has firmware embedded in ROM to support the monitor
mode, which is a privileged non-user mode. To enter the monitor mode, specific
general-purpose I/O pins must satisfy certain conditions out of reset. A high
voltage may also be required on the IRQ pin at the same time. Once the
conditions are satisfied, the monitor ROM code is executed instead of running
the user application program. A host computer can then communicate with the
MCU through a single I/O pin that “bit-bangs” a standard NRZ serial protocol.
The monitor ROM supports six commands; four of them are used for
reading/writing memory locations (READ, WRITE, IREAD, and IWRITE
commands), the fifth is used for running the user program (RUN command),
and the sixth is used for reading the stack pointer (READSP command). Just
before the MCU enters the monitor mode, an SWI instruction is executed in the
monitor code. To run the user program, the RUN command executes an RTI
instruction. While an MCU is in the monitor mode the CPU is used for running
the monitor code, so the user program cannot be run at the same time.
The HC08 Family has additional modes for testing a device other than user and
monitor modes. These modes are not open to the public. In one of the test
modes, data and address buses, and other signals such as a read/write signal,
replace I/O signals on the MCU pins. In addition to being able to test a device,
this mode enables building high-end emulator tools such as the Motorola
MMDS08 emulator. Since the internal buses can be observed through the MCU
pins, an emulator uses this mode to support a bus state analyzer function.
However since many I/O pins become unavailable to support those signals, the
lost MCU pin functions must be re-built outside the MCU. Therefore, the re-built
pin functions may not be exactly the same as the actual MCU. Furthermore,
some small pincount MCUs do not have enough pins to support the buses, so
it is more difficult to build an emulator.
The HCS08 Family has hardware that supports the background debug mode.
Specifically, the background debug controller (BDC) was designed to support
the background mode. Since the BDC consists of hardware logic, firmware like
the HC08 monitor ROM is not embedded inside the MCU. Therefore, the BDC
does not need to use the CPU or its instructions. The benefit of this is the BDC
can access internal memory even while the user program is running.
In the HC08 Family, the break module, which is independent of the monitor
mode, is implemented in the MCU to support the breakpoint and trace functions
for the debugger. When the CPU address matches the value written in the
break address register, this module generates a software interrupt instruction
(SWI). The HCS08 Family does not have this module. Instead, the BDC
includes hardware logic to support these functions. Therefore, when the break
address matches the value written in the BDC breakpoint register, the mode is
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA

Related parts for AN2497