Wiener CC-USB User Manual

Full-featured camac crate controller

Advertisement

Quick Links

CC-USB
User Manual
WIENER, Plein & Baus GmbH
1
www.wiener-d.com

Advertisement

Table of Contents
loading

Summary of Contents for Wiener CC-USB

  • Page 1 CC-USB User Manual WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 2 No part of this product, including the product and the software may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language in any form by any means with the express written permission of W-I CC-USB and VM-USB are designed by JTEC Instruments. WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 3: Table Of Contents

    Writing Data to the CAMAC Command Stacks and to the NAF Generator.. 18 Structure of the CAMAC Stack................18 CAMAC common functions................. 20 Structure of the IN Packets.................. 20 Guide to List Mode Data Acquisition with CC-USB ..........22 LIBXXUSB Library for Windows and Linux............23 xxusb_devices_find ....................23 xxusb_device_open....................23 xxusb_device_close....................
  • Page 4 ..................... 27 6.10 xxusb_usbfifo_read ....................28 6.11 xxusb_bulk_read ....................29 6.12 xxusb_bulk_write....................30 6.13 xxusb_flashblock_program.................. 31 WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 5: General Description

    FiFo. Combined with the front panel I/O ports this allows CAMAC operation and data taking without any PC or USB activity. All CC-USB logic is controlled by the XILINX Spartan 3 family FPGA. Upon power-up the FPGA boots from a flash memory. The configuration flash memory can be reprogrammed via the USB port, allowing convenient updates of the firmware.
  • Page 6: Cc-Usb Front Panel

    1.3 CC-USB Front panel Power LED for +6V / -6V INH, B, Q, X, C, Z LED’s 3 user LED’s (red, green, yellow) LAM (L1, L2, L4, L8, L16) LED’s 3 user inputs Lemo / NIM Station (N1, N2, N4, N8, N16) LED’s Sub-Address (A1, A2, A4, A8) LED’s...
  • Page 7: Block Diagram

    - Three-Stage Piplined FIFO Array (22 kBytes) Master - Control Unit USB Controller - FX2 CY7C68013 IC OUT FIFO - USB Out FIFO (Relative to Host) IN FIFO - USB In FIFO (Relative to Host) WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 8: Cc-Usb And Usb Driver Installation

    2.1 Installation for Windows Operating Systems 1. Switch off the CAMAC crate and remove the power cord. Plug in the CC-USB on the far right slots (normally slot 24 & 25) and secure it with the front panel screw. Switch on the CAMAC crate.
  • Page 9 5. Select manual search for the driver 6. Type in the drive letter for the CD-ROM (e.g. D:, F:, …) and locate the file CC-USB.inf. Press Enter to select this driver and to close the window. 7. The WIENER CC-USB driver should be listed and highlighted in the driver list. The driver is not digitally signed which however does not have any effect on it’s functionality.
  • Page 10 8. The “New Hardware Wizard” should copy all driver files into the Windows System32 folders and report a successful installation. WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 11: Installation For Linux Operating Systems

    9. Run the XXUSBWin.exe program from the program directory or use one of the sample programming packages to communicate with the CC-USB. 2.2 Installation for Linux Operating Systems Linux provides a library libusb that allows to perform the bulk transfer to and from the CC- USB and VM-USB USB port.
  • Page 12: General Architecture Of Cc-Usb And Its User Interface

    GENERAL ARCHITECTURE OF CC-USB AND ITS USER INTERFACE The CC-USB presents to the user five internal devices or addresses shown in Table 1: Table 1. Internal devices of CC-USB and their addresses Address Device Register Block (RB) CAMAC Data Readout Stack (CDS)
  • Page 13: Delays Register

    Numbers stored in these registers identify sources of User LEDs and NIM Outputs. The actual selection of sources is firmware specific and subject to customization. The general bit composition of the selector word is shown in the table below WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 14 Camac S1 USB In FIFO not full Data Buffer Full Camac S2 Reserved Reserved USB In FIFO not empty Acquire NIM I1 Executing scaler stack Camac F2 USB In FIFO not empty USB Trigger WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 15: Lam Mask Register

    USB. The serial number can be also obtained during the initialization of the USB port, e.g., by calling the libxxusb library function xxusb_devices_find. 3.2 CAMAC Command Stacks 3.3 CAMAC NAF Generator 3.4 USB In FIFO WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 16: Communicating With Cc-Usb

    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.
  • Page 17: General Structure Of Out Packets

    4.1 General structure of Out Packets Since internally, the USB controller of the CC-USB is set up as a 16-bit wide FIFO (First- In- First-Out Memory), the In and Out Packets are organized as collections of 16-bit words. For the purpose of the software, and more specifically, of the Windows Application Programming Interface (API) routines, the data are packed in byte-wide buffers, a process that may remain transparent to the user when proper set of routines (DLLs) is used.
  • Page 18: Writing Data To The Camac Command Stacks And To The Naf Generator

    The CAMAC NAF Generator (Address 8) is an internal module that interprets the information found either in the CAMAC Stacks (when CC-USB is in data acquiring mode) or in the Out Packet received from the USB port (when CC-USB is in interactive mode).
  • Page 19 Number of Product Terms – specifies the number of words in the stack that follow and that constitute bit masks for constructing a logical equation used in deciding whether the given operation is to be performed for the particular hit register data. WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 20: Camac Common Functions

    (up to 8192 bytes) compatible with the CC-USB functionality. Al data supplied by the CC-USB is to be read from the Endpoint 6. While reading, it is important to specify the length of the buffer not shorter than the length of the actual data buffer written by the CC-USB into this endpoint.
  • Page 21 CC-USB has dedicated 2kWords-long event FIFO to assemble events. To handle longer events, CC-USB splits the long event into parts, each of which appears as a separate event in the output buffer. The partial events are distinguishable by bit 12 of the Event Length word set, except for the last part.
  • Page 22: Guide To List Mode Data Acquisition With Cc-Usb

    CC-USB then formats the data read form the CAMAC bus and buffers them in a data buffer. When the buffer is full, CC-USB transfers its content to the In FIFO of the USB controller IC for a readout by host software.
  • Page 23: Libxxusb Library For Windows And Linux

    LIBXXUSB LIBRARY FOR WINDOWS AND LINUX A dedicated library of functions was developed to facilitate the utilization of CC-USB and its VME counterpart, VM-USB. This library is called libxxusb and requires the libusb0.sys driver to be installed. It is in fact a wrapper library for the general-use libusb-win32 library available via www.sourceforge.net...
  • Page 24: Xxusb_Device_Close

    6.4 xxusb_reset_toggle The xxusb_reset_toggle function toggles the reset state of the FPGA while XX-USB is in programming mode – rotary selector set in one of four P* positions. WORD xxusb_reset_toggle{ HANDLE hDevice, Parameters WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 25: Xxusb_Register_Write

    The xxusb_register_read function first, sends a buffer to XX-USB, causing the latter to write the content of a desired register to its USB port FIFO and then, obtains the value by reading the buffer from the XX-USB. WORD xxusb_register_read{ HANDLE hDevice, WORD wRegisterAddress, LPDWORD lpRegisterData Parameters WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 26: Xxusb_Stack_Write

    On success, the function returns the number of bytes sent to XX-USB. The latter value is twice the length of the stack plus 2 (for a header word identifying a stack as a target). Function returns a negative number on a failure. Remarks WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 27: Xxusb_Stack_Read

    The physical length of the regular stack is 768 16-bit words for CC-USB and 768 32-bit words for VM-USB. The physical length of the periodic (scaler) stack is 256 16-bit words for CC-USB and 256 32-bit words for VM-USB. While the stack is expected to contain properly encoded sequence of CAMAC (CC-USB) or VME (VM-USB) commands to be performed by XX-USB, it can store any sequence of numbers.
  • Page 28: Xxusb_Usbfifo_Read

    On success, the function returns the number of bytes read from XX-USB. The valid value is twice the number of 16-bit data words returned plus 2 (CC-USB) or 4(VM-USB). The latter “overhead” bytes contain event terminator word (0xFF for CC-USB, and 0xFFFF for VM- USB).
  • Page 29: Xxusb_Bulk_Read

    [in] Number of bytes to read. This number must be not less than the number of bytes stored in the output FIFO. wTimeout [in] Time in milliseconds, after which the I/O operation is canceled, should there be no data available for the readout. WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 30: Xxusb_Bulk_Write

    On success, the function returns the number of bytes read from XX-USB. Function returns a negative number on a failure, which in most cases signifies a timeout condition. Remarks The xxusb_usbfifo_read is given for the sake of completeness. WIENER, Plein & Baus GmbH www.wiener-d.com...
  • Page 31: Xxusb_Flashblock_Program

    256 on each consecutive call. The device must be in programming mode with the rotary selector in one of the 4 “P” positions. The configuration file of a XC3S200 FPGA of CC-USB will occupy 512 sectors of flash memory (512 calls to the xxusb_flashblock_program). The XC3S400 FPGA of VM-USB will occupy 830 sectors of flash memory.

This manual is also suitable for:

Vm-usb

Table of Contents