beautypg.com

10 write control register (wcreg) – Motorola ColdFire MCF5281 User Manual

Page 652

background image

Debug Support

30-34

Freescale Semiconductor

rcreg accn; // read the desired accumulator

wcreg #saved_data,macsr;// restore the original macsr

)

Likewise, the following BDM sequence is needed to write an accumulator register:

BdmWriteACCn (

rcreg macsr; // read macsr contents & save

wcreg #0,macsr; // disable all rounding modes

wcreg #data,accn; // write the desired accumulator

wcreg #saved_data,macsr;// restore the original macsr

)

Additionally, it is required that writes to the accumulator extension registers be performed after the
corresponding accumulators are updated. This is needed since a write to any accumulator alters the
contents of the corresponding extension register.

For more information on saving and restoring the complete EMAC programming model, see

Section 3.3.1.2, “Saving and Restoring the EMAC Programming Model

”.

30.5.3.3.10 Write Control Register (

WCREG

)

The operand (longword) data is written to the specified control register. The write alters all 32 register bits.

Command/Result Formats:

15

12

11

8

7

4

3

0

Command

0x2

0x8

0x8

0x0

0x0

0x0

0x0

0x0

0x0

Rc

Result

D[31:16]

D[15:0]

Figure 30-35.

WCREG

Command/Result Formats

MCF5282 and MCF5216 ColdFire Microcontroller User’s Manual, Rev. 3

This manual is related to the following products: