Chapter 20 Debug (S12XDBGV2)
MC9S12XDP512 Data Sheet, Rev. 2.11
818 Freescale Semiconductor
20.4.4 State Sequence Control
Figure 20-23. State Sequencer Diagram
The state sequence control allows a defined sequence of events to provide a trigger point for tracing of data
in the trace buffer. Once the DBG module has been armed by setting the ARM bit in the DBGC1 register,
then State1 of the state sequencer is entered. Further transitions between the states are then controlled by
the state control registers and depend upon a selected trigger mode condition being met. From final state
the only permitted transition is back to the disarmed state0. Transition between any of the states 1 to 3 is
not restricted. Each transition updates the SSF[2:0] flags in DBGSR accordingly to indicate the current
state.
Alternatively writing to the TRIG bit in DBGSC1, the final state is entered and tracing starts immediately
if the TSOURCE bits are configured for tracing.
A tag hit through TAGHI/TAGLO causes a breakpoint, if breakpoints are enabled, and ends tracing
immediately independent of the trigger alignment bits TALIGN[1:0].
Furthermore, each comparator channel can be individually configured to generate an immediate
breakpoint when a match occurs through the use of the BRK bits in the DBGxCTL registers independent
of the state sequencer state. Thus it is possible to generate an immediate breakpoint on selected channels,
while a state sequencer transition can be initiated by a match on other channels.
An XGATE S/W breakpoint request, if enabled causes a transition to the final state and generates a
breakpoint request to the CPU immediately.
If neither tracing nor breakpoints are enabled then, when a forced match triggers to final state, it can only
be returned to the disarmed state0 by clearing the ARM bit by software. This also applies to the case that
BDM breakpoints are enabled, but the BDM is disabled. Furthermore if neither tracing nor breakpoints are
enabled, forced triggers on channels with BRK set cause a transition to the state determined by the state
sequencer as if the BRK bit were not being used.
If neither tracing nor breakpoints are enabled then when a tagged match triggers to final state, the state
sequencer returns to the disarmed state0.
State1
Final State State3
ARM = 1
Session complete
(disarm)
State2
State 0
(Disarmed)
ARM = 0
ARM=0
ARM = 0