Chapter 20 Debug (S12XDBGV2)
MC9S12XDP512 Data Sheet, Rev. 2.11
Freescale Semiconductor 827

20.4.6.1 External Tagging using TAGHI and TAGLO

External tagging using the external TAGHI and TAGLO pins can only be used to tag CPU opcodes; tagging
of XGATE code using these pins is not possible. An external tag triggers the state sequencer into State0
when the tagged opcode reaches the execution stage of the instruction queue.
The pins operate independently, thus the state of one pin does not affect the function of the other. External
tagging is possible in emulation modes only. The presence of logic level 0 on either pin at the rising edge
of the external clock (ECLK) performs the function indicated in the Table 20-43. It is possible to tag both
bytes of an instruction word. If a taghit comes from the low or high byte, a breakpoint generated according
to the DBGBRK and BDM bits in DBGC1. Each time TAGHI or TAGLO are low on the rising edge of
ECLK, the old tag is replaced by a new one
20.4.7 Breakpoints
It is possible to select breakpoints to the XGATE and let the CPU continue operation, setting DBGBRK[0],
or breakpoints to the CPU and let the XGATE continue operation setting, DBGBRK[1], or a breakpoint to
both CPU and XGATE, setting both bits DBGBRK[1:0].
There are several ways to generate breakpoints to the XGATE and CPU modules.
Through XGATE software breakpoint requests.
From comparator channel triggers to final state.
Using software to write to the TRIG bit in the DBGC1 register.
From taghits generated using the external TAGHI and TAGLO pins.

20.4.7.1 XGATE Software Breakpoints

The XGATE software breakpoint instruction BRK can request an CPU breakpoint, via the DBG module.
In this case, if the XGSBPE bit is set, the DBG module immediately generates a forced breakpoint request
to the CPU, the state sequencer is returned to state0 and tracing, if active, is terminated. If configured for
begin-trigger and tracing has not yet been triggered from another source, the trace buffer contains no new
information. Breakpoint requests from the XGATE module do not depend upon the state of the DBGBRK
or ARM bits in DBGC1. They depend solely on the state of the XGSBPE and BDM bits. Thus it is not
necessary to ARM the DBG module to use XGATE software breakpoints to generate breakpoints in the
CPU program flow, but it is necessary to set XGSBPE. Furthermore if a breakpoint to BDM is required,
the BDM bit must also be set. When the XGATE requests an CPU breakpoint, the XGATE program flow
stops by default, independent of the DBG module. The user can thus determine if an XGATE breakpoint
has occurred by reading out the XGATE program counter over the BDM interface.
Table 20-43. Tag Pin Function
TAGHI TAGLO Tag
1 1 No tag
1 0 Low byte
0 1 High byte
0 0 Both bytes