![](http://datasheet.mmic.net.cn/370000/P9S12XEP100J1VVLR_datasheet_16728329/P9S12XEP100J1VVLR_329.png)
Chapter 8 S12X Debug (S12XDBGV3) Module
MC9S12XE-Family Reference Manual Rev. 1.07
Freescale Semiconductor
329
8.4.2.3
Data Bus Comparison NDB Dependency
ComparatorsAandCeachfeatureanNDBcontrolbit,whichallowsdatabuscomparatorstobeconfigured
to either trigger on equivalence or trigger on difference. This allows monitoring of a difference in the
contents of an address location from an expected value.
When matching on an equivalence (NDB=0), each individual data bus bit position can be masked out by
clearing the corresponding mask bit (DBGxDHM/DBGxDLM), so that it is ignored in the comparison. A
match occurs when all data bus bits with corresponding mask bits set are equivalent. If all mask register
bits are clear, then a match is based on the address bus only, the data bus is ignored.
Whenmatchingonadifference,maskbitscanbeclearedtoignorebitpositions.Amatchoccurswhenany
databusbitwithcorrespondingmaskbitsetisdifferent.Clearingallmaskbits,causesallbitstobeignored
and prevents a match because no difference can be detected. In this case address bus equivalence does not
cause a match.
8.4.2.4
Range Comparisons
WhenusingtheABcomparatorpairforarangecomparison,thedatabuscanalsobeusedforqualification
by using the comparator A data and data mask registers. Furthermore the DBGACTL RW and RWE bits
can be used to qualify the range comparison on either a read or a write access. The corresponding
DBGBCTL bits are ignored. Similarly when using the CD comparator pair for a range comparison, the
data bus can also be used for qualification by using the comparator C data and data mask registers.
Furthermore the DBGCCTL RW and RWE bits can be used to qualify the range comparison on either a
read or a write access if tagging is not selected. The corresponding DBGDCTL bits are ignored. The SZE
and SZ control bits are ignored in range mode. The comparator A and C TAG bits are used to tag range
comparisons for the AB and CD ranges respectively. The comparator B and D TAG bits are ignored in
range modes. In order for a range comparison using comparators A and B, both COMPEA and COMPEB
mustbeset;todisablerangecomparisonsbothmustbecleared.SimilarlyforarangeCDcomparison,both
COMPEC and COMPED must be set. If a range mode is selected SRCA and SRCC select the source
(S12X or XGATE), SRCB and SRCD are ignored. The comparator A and C BRK bits are used for the AB
and CD ranges respectively, the comparator B and D BRK bits are ignored in range mode. When
configured for range comparisons and tagging, the ranges are accurate only to word boundaries.
8.4.2.4.1
Inside Range (CompAC_Addr
≤
address
≤
CompBD_Addr)
In the Inside Range comparator mode, either comparator pair A and B or comparator pair C and D can be
configured for range comparisons by the control register (DBGC2). The match condition requires that a
valid match for both comparators happens on the same bus cycle. A match condition on only one
Table 8-40. NDB and MASK bit dependency
NDB
DBGxDHM[n] /
DBGxDLM[n]
Comment
0
0
Do not compare data bus bit.
0
1
Compare data bus bit. Match on equivalence.
1
0
Do not compare data bus bit.
1
1
Compare data bus bit. Match on difference.