English
Language : 

MC9S12G Datasheet, PDF (306/1160 Pages) Freescale Semiconductor, Inc – Ignores external trigger. Performs one conversion sequence and stops.
S12S Debug Module (S12SDBG)
8.4.5 Trace Buffer Operation
The trace buffer is a 64 lines deep by 20-bits wide RAM array. The DBG module stores trace information
in the RAM array in a circular buffer format. The system accesses the RAM array through a register
window (DBGTBH:DBGTBL) using 16-bit wide word accesses. After each complete 20-bit trace buffer
line is read, an internal pointer into the RAM increments so that the next read receives fresh information.
Data is stored in the format shown in Table 8-36 and Table 8-39. After each store the counter register
DBGCNT is incremented. Tracing of CPU activity is disabled when the BDM is active. Reading the trace
buffer whilst the DBG is armed returns invalid data and the trace buffer pointer is not incremented.
8.4.5.1 Trace Trigger Alignment
Using the TALIGN bit (see Section 8.3.2.3, “Debug Trace Control Register (DBGTCR)) it is possible to
align the trigger with the end or the beginning of a tracing session.
If End tracing is selected, tracing begins when the ARM bit in DBGC1 is set and State1 is entered; the
transition to Final State signals the end of the tracing session. Tracing with Begin-Trigger starts at the
opcode of the trigger. Using End Trigger or when the tracing is initiated by writing to the TRIG bit whilst
configured for Begin-Trigger, tracing starts in the second cycle after the DBGC1 write cycle.
8.4.5.1.1 Storing with Begin-Trigger
Storing with Begin-Trigger, data is not stored in the Trace Buffer until the Final State is entered. Once the
trigger condition is met the DBG module remains armed until 64 lines are stored in the Trace Buffer. If the
trigger is at the address of the change-of-flow instruction the change of flow associated with the trigger is
stored in the Trace Buffer. Using Begin-trigger together with tagging, if the tagged instruction is about to
be executed then the trace is started. Upon completion of the tracing session the breakpoint is generated,
thus the breakpoint does not occur at the tagged instruction boundary.
8.4.5.1.2 Storing with End-Trigger
Storing with End-Trigger, data is stored in the Trace Buffer until the Final State is entered, at which point
the DBG module becomes disarmed and no more data is stored. If the trigger is at the address of a change
of flow instruction, the trigger event is not stored in the Trace Buffer.
8.4.5.2 Trace Modes
Four trace modes are available. The mode is selected using the TRCMOD bits in the DBGTCR register.
Tracing is enabled using the TSOURCE bit in the DBGTCR register. The modes are described in the
following subsections.
8.4.5.2.1 Normal Mode
In Normal Mode, change of flow (COF) program counter (PC) addresses are stored.
COF addresses are defined as follows:
• Source address of taken conditional branches (long, short, bit-conditional, and loop primitives)
• Destination address of indexed JMP, JSR, and CALL instruction
MC9S12G Family Reference Manual, Rev.1.01
306
Freescale Semiconductor
This document is valid for the S12G96 and the S12G128 device. All information related to other devices is preliminary.