23
4.6.3
Read Data command
The Read Data command reads data from an EM405-8 control/status register or from a register
residing on an M-Module. The command consists of five bytes including the command-id, the
module from which the data should be read, as address space selector, the access width and the
address from which to read. The return value consists of two data bytes followed by a single
status byte.
Command Syntax:
0x30 md as ws ad
Return:
dh dl SC
where
md = module (0 = EM405-8 control, 1 = M-Module 0, 2 = M-Module 1, …)
as = address space (0 = I/O, 1 = future use)
ws = word size (2 = 16-bit word, other values for future use)
ad = address (0 to FF)
dh = data (MSB)
dl = data (LSB)
SC = Status Code
Example (values shown hex):
To read the Device Identification Register on the EM405-8, send the following command:
Command:
cd md as ws ad
Send:
30 00 00 02 02
Receive:
0F DB 00 (if successful)
4.6.4
Block Access
The EM405-8 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
,
address increment, block size
, and
number of blocks
.
The EM405-8 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.
C&H Technologies, Inc. <> 445 Round Rock West Drive <> Round Rock, Texas 78681 <> www.chtech.com
Содержание EM405-8
Страница 46: ...A 2 C H Technologies Inc 445 Round Rock West Drive Round Rock Texas 78681 www chtech com ...
Страница 47: ...N O T E S C H Technologies Inc 445 Round Rock West Drive Round Rock Texas 78681 www chtech com ...
Страница 48: ... C H Technologies Inc 445 Round Rock West Drive Round Rock Texas 78681 www chtech com ...