AN2497 Freescale Semiconductor / Motorola, AN2497 Datasheet - Page 9

no-image

AN2497

Manufacturer Part Number
AN2497
Description
HCS08 Background Debug Mode versus HC08 Monitor Mode
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
READ_BYTE_WS
and
WRITE_BYTE_WS
READ_BKPT and
WRITE_BKPT
ACK_ENABLE and
ACK_DISABLE
Background Mode Entry
MOTOROLA
HCS08 Background Debug Mode versus HC08 Monitor Mode
These commands are used for reading and writing data to an address specified
by the user. These commands report the contents of the BDCSCR register
when they are executed.
These commands are used for reading and writing the BDC breakpoint
register. This register is not in the user memory map. One hardware breakpoint
is placed in the user program when the BDC breakpoint enable bit (BKPTEN)
in BDCSCR is enabled. When a break occurs, the mode is switched from the
user mode to the active background mode. Note the MCU does not need to be
in the active background mode when the breakpoint is set and enabled. The
breakpoint function is available even while the user program is running.
These commands can provide an option for a handshake protocol in the BDC
communication. When the handshake protocol is enabled, an acknowledge
(ACK) pulse is issued when a command is executed.
As mentioned in an earlier section, the background debug mode can be
entered in several ways. In all cases, a BDM pod of some sort is connected to
the BKGD pin. The hardware entry method would generally be used when the
MCU's memory is not programmed, such that it cannot execute a user
program. External hardware or the BDM pod releases the RESET pin after the
BKGD and RESET pins are pulled low, and then pulls the BKGD pin high. In
this method, the MCU enters the active background mode instead of the normal
user mode. A FLASH memory programming or erase function can be
accomplished at this time. This sequence is typically used to in-circuit program
a blank MCU.
The software entry methods are more typically used in a debug session. In
these cases the MCU is operating in the normal user mode and an MCU reset
is not required. The BDM pod simply sends non-intrusive commands to the
MCU through the BKGD pin. The user can communicate with the MCU without
disturbing the running application program. Debug operations such as reading
or writing a RAM variable can be performed while the program is running.
Erasing and programming FLASH memory is not performed with these
non-intrusive commands.
For more in-depth debugging sessions, the host can command the BDC to
enable background mode (ENBDM = 1) and then switch from the running user
program to active background mode (program operation stops). This is
generally the case when the user wants to debug code by tracing instructions
and setting breakpoints. The following three methods are used to enter active
background mode.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
Background Mode Entry
AN2497/D
9

Related parts for AN2497