CH Tech EM405D User Manual

Page 26

Advertising
background image

20

Example (values shown hex):

To read the Device Identification Register on the EM405D, send the following command:


Command:

cd md as ws ad

Send:

30 00 00 02 02


Receive:

0F DB 00 (if successful)


4.3.4 Block Access

The EM405D provides a flexible block access feature that can be used to significantly improve
data throughput. Both a block read and a block write command is implemented. The flexibility
of the bock access feature is in the command protocol. The protocol allows the user to specify
four parameters in addition to the standard parameters also found in the single data read and
write commands: starting address, block size, number of blocks, and address increment.

The EM405D firmware will execute the command by reading or writing a block of data the size
of the block size parameter, starting from the starting address and ending at:


starting address + (block size * word size)

The firmware will then repeat this process N number of times depending on the number of blocks
parameter. If the address increment parameter is not equal to 0, the firmware will increment the
starting address by the specified amount after each read or write of a single block.

The M-module I/O space is a maximum of 256 bytes. Care must be taken when performing a
block access that an address greater than 0xFF is never accessed. Otherwise, an error will occur
and the block access will terminate immediately.

The following examples further illustrate the block access feature.

Example 1:

Read a single block of 32 words (64 bytes) starting at address 0x4.


starting address = 0x4

block size = 32

number of blocks = 1

address increment

= don’t care

Example 2:

Read 32 words (64 bytes) from a FIFO at address 0x8.


starting address = 0x8

block size = 1

number of blocks = 32

address increment = 0

Example 3:

Read 32 words from two FIFOs one at address 0x8 and another at address 0xA


starting address = 0x8

block size = 2

number of blocks = 32

address increment = 0

Advertising