Communicating With Cc-Usb - Wiener CC-USB User Manual

Full-featured camac crate controller
Table of Contents

Advertisement

4

COMMUNICATING WITH CC-USB

Communication with the CC-USB consists in writing and reading of buffers of data to/from
the USB2 port of the CC-USB using bulk-transfer mode. Borrowing from the USB language,
the buffers to be written to the CC-USB will be called Out Packets, and they are sent to pipe
0 of the USB port. The buffers to be read will be called In Packets, and they are read from
pipe 2 of the USB port.
The USB controller IC, when connected to a USB2 port configures packet lengths to 512
bytes. For USB1 (full speed), the packet length is set to 64 bytes. The Out Packets must be
properly formatted to be understood by the internal devices of CC-USB and, by the same
token, the format of the In Packets retrieved from the CC-USB must be understood by the
user in order to be useful.
User may send Out Packets to four devices – the Register Block (RB), CAMAC Readout
Stacks (CDS and CSS), and the NAF Generator (RB, CDS, CCS, CNAF). User may read In
Packets only from the Common Output Buffer. Reading back data from the RB, CDS, and
CSS is achieved by, first sending a data request Out Packet to these devices and then by
reading the In Packet containing the requested data from the Common Output Buffer.
Writing to the CAMAC NAF Generator constitutes implicitly a request for data, such that in
response to such a writing, CC-USB performs the requested CAMAC operation and returns
the CAMAC data in the Common Output Buffer. Both, In and Out Packets are of a variable
length, depending on which internal address is involved and what the content of the message
is.
Important Note:
With some drivers (EZUSB in conjunction with Windows API), read operations from the
USB port are blocking operations such that the host program will stop executing until the
data are available at the port. Therefore, the host program must make sure (by first requesting
data) that CC-USB has placed data in the Common Output Buffer (physically this is the
FIFO of the USB controller IC), before the read command is issued. CC-USB provides a
mechanism for supplying data, even when the host program is "frozen" in a state of waiting
for data. The mechanism consists in starting a second copy of the program and issuing a bare
request for data command from this second copy, not followed by the read IN Packet
command.
The libxxusb package of CC-USB access functions makes overlapped USB calls that have
preset timeout periods. When no data is available until the end of this period, the I/O is
canceled and the respective function returns error code. The user is then expected to take
proper actions, which may include resubmitting the call.
It is important to specify a sufficiently long In Packet size to be at least of the size of the
actual data buffer available at the Common Output Buffer. This is especially important in the
case of reading CAMAC data buffers which differ in size substantially depending on the
structure of the CAMAC Readout Stack.
WIENER, Plein & Baus GmbH
16
www.wiener-d.com

Advertisement

Table of Contents
loading

Related Products for Wiener CC-USB

This manual is also suitable for:

Vm-usb

Table of Contents