Debug Module
MCF52235 ColdFire® Integrated Microcontroller Reference Manual, Rev. 6
Freescale Semiconductor
31-35
31.4.1.5.12
BDM Accesses of the EMAC Registers
The presence of rounding logic in the output datapath of the EMAC requires special care for
BDM-initiated reads and writes of its programming model. In particular, any result rounding modes must
be disabled during the read/write process so the exact bit-wise EMAC register contents are accessed.
For example, a BDM read of an accumulator (ACC
x
) must be preceded by two commands accessing the
MAC status register, as shown in the following sequence:
BdmReadACCx (
rcreg
macsr;
// read current macsr contents and save
wcreg
#0,macsr;
// disable all rounding modes
rcreg
ACCx;
// read the desired accumulator
wcreg
#saved_data,macsr;// restore the original macsr
)
Likewise, to write an accumulator register, the following BDM sequence is needed:
BdmWriteACCx (
rcreg
macsr;
// read current macsr contents and save
wcreg
#0,macsr;
// disable all rounding modes
wcreg
#data,ACCx;
// write the desired accumulator
wcreg
#saved_data,macsr;// restore the original macsr
)
Additionally, writes to the accumulator extension registers must be performed after the corresponding
accumulators are updated because a write to any accumulator alters the corresponding extension register
contents.
For more information on saving and restoring the complete EMAC programming model, see
Section 4.3.1.2, “Saving and Restoring the EMAC Programming Model.”
31.4.1.5.13
Write Control Register (
WCREG
)
The operand (longword) data is written to the specified control register. The write alters all 32 register bits.
See the RCREG instruction description for the Rc encoding and for additional notes on writes to the A7
stack pointers and the EMAC programming model.
Command/Result Formats:
Command Sequence:
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Command
0x2
0x8
0x8
0x0
0x0
0x0
0x0
0x0
0x0
Rc
Result
D[31:16]
D[15:0]
Figure 31-37.
WCREG
Command/Result Formats
Because
of
an
order
from
the
United
States
International
Trade
Commission,
BGA-packaged
product
lines
and
part
numbers
indicated
here
currently
are
not
available
from
Freescale
for
import
or
sale
in
the
United
States
prior
to
September
2010:MCF52234CVM60,
MCF52235CVM60