beautypg.com

Spw-10x spacewire router, User manual, Preliminary – Atmel SpaceWire Router SpW-10X User Manual

Page 68: Ref.: uod_spw-10x_ usermanual issue: 3.4, Date: 11, July 2008, Figure 7-8 read-modify-write example operation

background image

Ref.: UoD_SpW-10X_

UserManual

Issue: 3.4

SpW-10X

SpaceWire Router

User Manual

Date: 11

th

July 2008

Preliminary

68

Mask

Length

4 bytes for the mask to modify a 32-bit register.

Header

CRC

The header CRC used to detect errors in the header part of the command

packet.

1

Data and

Mask

The data and mask values to write to the SpaceWire router. The data is

written dependent on the mask as shown in Figure 7-8.

8

Data and

Mask CRC

The data and mask CRC used to detect errors in the data part of the

command packet.

1

A Read-Modify-Write command modifies the bits of a SpaceWire router register dependent on the
contents of the register (Register Data), the command data (Command Data) and the command mask
value (Mask) as follows:

Register Value = (Mask AND Command Data) OR (NOT Mask AND Register Data)

An example is shown below, the highlighted bits are set or reset by the command.

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

31

23

0 1 1 0 0 0 1 1 0 0 0 0 0 0 0 0

15

0

7

Command Data

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

31

23

1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

15

0

7

Command Mask

1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

31

23

1 0 1 0 0 1 0 0 0 0 0 0 1 0 1 0

15

0

7

Register Data
Returned to source

1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0

31

23

0 1 1 0 0 0 1 1

0 0 0 0 1 0 1 0

15

0

7

Data Written to Register

(Mask AND Command Data) OR (NOT Mask and Register Data)

Figure 7-8 Read-Modify-Write example operation