Example 4: Read 32 words starting at address 0x0 followed by 32 words starting at address 0x80
starting address = 0x0 block size = 32 number of blocks = 2 address increment = 128
4.3.4.1Block Write command
The Block Write command writes a block of data to an
number of bytes = number of blocks * block size * word size
The block write command consists of nine command bytes and any number (up to 1024) of data bytes. The return value is a single status byte indicating the success of the command.
Command Syntax:
0x40 md as ws ad ai nh nl bs d1 d0 …
Return:
SC
where
md = module (0 = invalid, 1 =
ws = word size (2 =
ai = address increment (number to increment address by after each write) nh = number of blocks to read (upper 4 bits)
nl = number of blocks to read (lower 8 bits)
bs = block size in words (i.e., number of words per block)
d1 = data (MSB)
d0 = data (LSB)
…= the number of data bytes = ws × bs × nb SC = Status Code
Example (values shown hex):
To write the data values 0x1234, 0x5678, 0x9ABC to
Command: | cd | md | as | ws | ad | ai | nh | nl | bs | dh1 dl1 | dh2 dl2 | dh3 dl3 | |||
Send: | 40 | 01 | 00 | 02 | 04 | 02 | 00 | 03 | 01 | 12 | 34 | 56 | 78 | 9A | BC |
Receive: | 00 (if successful) |
|
|
|
|
|
|
|
|
|
|
|
21