English
Language : 

Z8F6421PM020SC Datasheet, PDF (218/299 Pages) Zilog, Inc. – High Performance 8-Bit Microcontrollers Z8 Encore-R 64K Series
Z8 Encore!® 64K Series
Product Specification
198
finish the interrupt service routine it may be in and return the BRK instruction. When the
CPU returns to the BRK instruction it was previously looping on, it automatically sets the
DBGMODE bit and enter DEBUG mode.
Software detects that the majority of the OCD commands are still disabled when the eZ8
CPU is looping on a BRK instruction. The eZ8 CPU must be stopped and the part must be
in DEBUG mode before these commands can be issued.
Breakpoints in Flash Memory
The BRK instruction is opcode 00H, which corresponds to the fully programmed state of a
byte in Flash memory. To implement a Breakpoint, write 00H to the desired address, over-
writing the current instruction. To remove a Breakpoint, the corresponding page of Flash
memory must be erased and reprogrammed with the original data.
On-Chip Debugger Commands
The host communicates to the On-Chip Debugger by sending OCD commands using the
DBG interface. During normal operation, only a subset of the OCD commands are avail-
able. In DEBUG mode, all OCD commands become available unless the user code and
control registers are protected by programming the Read Protect Option Bit (RP). The
Read Protect Option Bit prevents the code in memory from being read out of the 64K
Series products. When this option is enabled, several of the OCD commands are disabled.
Table 100 contains a summary of the On-Chip Debugger commands. Each OCD com-
mand is described in further detail in the bulleted list following Table 100. Table 100 indi-
cates those commands that operate when the device is not in DEBUG mode (normal
operation) and those commands that are disabled by programming the Read Protect
Option Bit.
Table 100. On-Chip Debugger Commands
Debug Command
Enabled when NOT
Command Byte in DEBUG mode?
Read OCD Revision
00H
Yes
Read OCD Status Register
02H
Yes
Read Runtime Counter
03H
-
Write OCD Control Register
04H
Yes
Read OCD Control Register
05H
Yes
Write Program Counter
06H
-
Read Program Counter
07H
-
Disabled by
Read Protect Option Bit
-
-
-
Cannot clear DBGMODE bit
-
Disabled
Disabled
PS019915-1005
On-Chip Debugger