Spectrum M3i.4830 Hardware Manual

M3i.48 series m3i.48-exp series high-speed 16 bit transient recorder, a/d converter board for pci-x, pci and pci express bus
Table of Contents

Advertisement

Quick Links

M3i.48xx
M3i.48xx-exp
high-speed 16 bit transient recorder,
A/D converter board
for PCI-X, PCI and PCI Express bus
Hardware Manual
Software Driver Manual
English version
November 21, 2016
SPECTRUM SYSTEMENTWICKLUNG MICROELECTRONIC GMBH · AHRENSFELDER WEG 13-17 · 22927 GROSSHANSDORF · GERMANY
PHONE: +49 (0)4102-6956-0 · FAX: +49 (0)4102-6956-66 · E-MAIL: info@spec.de · INTERNET: http://www.spectrum-instrumentation.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the M3i.4830 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Spectrum M3i.4830

  • Page 1 PCI-X, PCI and PCI Express bus Hardware Manual Software Driver Manual English version November 21, 2016 SPECTRUM SYSTEMENTWICKLUNG MICROELECTRONIC GMBH · AHRENSFELDER WEG 13-17 · 22927 GROSSHANSDORF · GERMANY PHONE: +49 (0)4102-6956-0 · FAX: +49 (0)4102-6956-66 · E-MAIL: info@spec.de · INTERNET: http://www.spectrum-instrumentation.com...
  • Page 2 (c) SPECTRUM SYSTEMENTWICKLUNG MICROELECTRONIC GMBH AHRENSFELDER WEG 13-17, 22927 GROSSHANSDORF, GERMANY SBench, digitizerNETBOX and generatorNETBOX are registered trademarks of Spectrum Systementwicklung Microelectronic GmbH. Microsoft, Visual C++, Visual Basic, Windows, Windows 98, Windows NT, Window 2000, Windows XP, Windows Vista, Windows 7, Windows 8, Windows 10 and Windows Server are trademarks/registered trademarks of Microsoft Corporation.
  • Page 3: Table Of Contents

    Different models of the M3i.48xx series ..........................9 Additional options ................................10 Star-Hub ..................................10 BaseXIO (versatile digital I/O) ............................10 The Spectrum type plate ..............................11 Hardware information................................. 12 Block diagram................................12 Technical Data ................................13 Dynamic Parameters ..............................15 Order Information.................................
  • Page 4 Software ......................... 33 Software Overview................................33 Card Control Center ................................33 Discovery of Remote Cards and digitizerNETBOX/generatorNETBOX products..............34 Wake On LAN of digitizerNETBOX/generatorNETBOX ....................34 Netbox Monitor ................................34 Hardware information..............................35 Firmware information ..............................35 Driver information................................. 36 Installing and removing Demo cards ..........................
  • Page 5 Analog Inputs........................63 Channel Selection ................................63 Important note on channels selection ..........................63 Setting up the inputs ................................64 Input Path ..................................64 Input ranges................................. 64 Read out of input features .............................. 65 Input termination................................66 Input coupling ................................66 AC/DC offset compensation ............................
  • Page 6 Mode Multiple Recording ....................104 Recording modes ................................104 Standard Mode................................104 FIFO Mode ................................104 Limits of pre trigger, post trigger, memory size ....................... 105 Multiple Recording and Timestamps ..........................105 Trigger Modes ................................. 105 Trigger Counter ................................105 Programming examples..............................
  • Page 7 Appendix ........................132 Error Codes ..................................132 Continuous memory for increased data transfer rate ......................134 Background ................................134 Setup on Windows systems............................134 Setup on Linux systems ..............................134 Usage of the buffer ..............................135 Details on M3i cards I/O lines............................136 Multi Purpose I/O Lines...............................
  • Page 8: Introduction

    133 MHz x 64 bit = 1 GByte/s per bus, is more and more replaced by the PCI Express standard with up to 4 GByte/s data transfer rate per slot. The Spectrum M3i boards are available in two versions, for PCI/PCI-X as well as for PCI Express. The 100% software compatible standards allow to combine both standards in one system with the same driver and software commands.
  • Page 9: Different Models Of The M3I.48Xx Series

    Different models of the M3i.48xx series The following overview shows the different available models of the M3i.48xx series. They differ in the number of available channels. You can also see the model dependent location of the input connectors. • M3i.4830 • M3i.4840 • M3i.4860 •...
  • Page 10: Additional Options

    Additional options Introduction Additional options Star-Hub The star hub piggy-back module al- lows the synchronization of up to 8 M3i cards. It is possible to synchro- nize cards of the same type with each other as well as different types. Two different versions of the star-hub module are available.
  • Page 11: The Spectrum Type Plate

    The Spectrum type plate The Spectrum type plate, which consists of the following components, can be found on all of our boards. Please check whether the printed information is the same as the information on your delivery note. All this information can also be read out by software: The board type, consisting of the two letters describing the bus (in this case M2i for the PCI-X bus) and the model number.
  • Page 12: Hardware Information

    Hardware information Introduction Hardware information Block diagram M3i.48xx / M3i.48xx-exp Manual...
  • Page 13: Technical Data

    External clock input duty cycke requirement 40% to 60% External clock output type Single-ended, 3.3V LVPECL External clock output coupling AC coupling ABA mode clock divider for slow clock software programmable 8 up to [128k - 8] in steps of 8 (c) Spectrum GmbH...
  • Page 14 Hardware information Introduction M3i.4830 M3i.4831 M3i.4840 M3i.4841 M3i.4860 M3i.4861 min sampling clock 9 MS/s 9 MS/s 9 MS/s 9 MS/s 9 MS/s 9 MS/s max internal clock (1 channel active) 65 MS/s 65 MS/s 105 MS/s 105 MS/s 180 MS/s...
  • Page 15: Dynamic Parameters

    12.1 12.1 11.6 12.0 12.0 11.9 11.8 M3i.4831 and M3i.4830, 1 or 2 channels 65 MS/s Input Path HF path, AC coupled, fixed 50 Ohm Buffered path, BW limit Buffered path, full BW Test signal frequency 1 MHz 10 MHz...
  • Page 16: Order Information

    Upgrade for M3i.xxxx: later installation of option -bxio, -SH4, SH8 or SMA connectors Services Order no. WarrExt5 Warranty extension from 2 years standard warranty to 5 years Recal Recalibration at Spectrum incl. calibration protocol Standard Cables Order no. for Connections Length to BNC male...
  • Page 17: Hardware Installation

    System Requirements All Spectrum M2i/M3i.xxxx instrumentation cards are compliant to the PCI standard and require in general one free full length slot. This can either be a standard 32 bit PCI legacy slot, a 32 bit or a 64 bit PCI-X slot. Depending on the installed options additional free slots can be necessary.
  • Page 18: Installing The Board In The System

    Before installing the board you first need to unscrew and remove the dedicated blind-bracket usually mounted to cover unused slots of your PC. Please keep the screw in reach to fasten your Spectrum card afterwards. All Spectrum cards require a full length PCI, PCI-X slot (either 32Bit or 64Bit) or PCI Express slot (either x1, x4, x8 or x16) with a track at the backside to guide the board by its retainer.
  • Page 19 Hardware Installation Installing the board in the system Installing the M2i/M3i.xxxx-exp PCI Express card in a PCIe x1 slot Installing the M2i/M3i.xxxx-exp PCI Express card in a PCIe x4, x8 or x16 slot (c) Spectrum GmbH...
  • Page 20: Installing A Board With Digital Inputs/Outputs Mounted On An Extra Bracket

    Before installing the board you first need to unscrew and remove the dedicated blind-brackets usually mounted to cover unused slots of your PC. Please keep the screws in reach to fasten your Spectrum board and the extra bracket afterwards. All Spectrum boards require a full length PCI slot with a track at the backside to guide the board by its retainer.
  • Page 21: Installing A Board With Option Basexio

    Before installing the board you first need to unscrew and remove the dedicated blind-brackets usually mounted to cover unused slots of your PC. Please keep the screws in reach to fasten your Spectrum board and the extra bracket afterwards. All Spectrum boards require a full length PCI slot with a track at the backside to guide the board by its retainer.
  • Page 22: Installing Multiple Boards Synchronized By Star-Hub Option

    Before installing the cards you first need to unscrew and remove the dedicated blind-brackets usually mounted to cover unused slots of your PC. Please keep the screws in reach to fasten your Spectrum cards afterwards. All Spectrum boards require a full length PCI slot with a track at the backside to guide the card by its retainer.
  • Page 23: Software Driver Installation

    Most available drivers and also the Spectrum driver for your board can manage interrupt sharing. But there are also some drivers on the market that can only use one interrupt exclusively. If this equipment shares an interrupt with the Spectrum board, the system will hang up if the second driver is loaded (the time is depending on the operating system).
  • Page 24: Windows 2000

    Software Driver Installation Windows 2000 Installation When installing the board in a Windows 2000 system the Spectrum board will be rec- ognized automatically on the next start-up. The system offers the direct in- stallation of a driver for the board.
  • Page 25: Driver - Update

    Windows 2000 Driver - Update If a new driver version should be installed no Spectrum board is allowed to be in use by any software. So please stop and exit all software that could access the boards. A new driver version is direct- ly installed from the device manager.
  • Page 26: Windows Xp 32 (64 Bit Discontinued)

    Windows XP 32 (64 Bit discontinued) Installation When installing the board in a Windows XP system the Spectrum board will be rec- ognized automatically on the next start-up. The system offers the direct installation of a driver for the board.
  • Page 27: Driver - Update

    This information is also available through the Spectrum Control Center. Driver - Update If a new driver version should be installed no Spectrum board is allowed to be in use by any software. So please stop and exit all software that could access the boards.
  • Page 28: Windows 7, 32/64 Bit

    Microsoft homepage. This mechanism will fail at first for the „DPIO Module“ device, as shown on the right, because the Spectrum drivers are not available via Microsoft, so simply close the dialog. Afterwards open the device manager from the Win- dows control panel, as shown on the right.
  • Page 29: Version Control

    The driver update under Windows 7 is exact the same procedure as the initial installation. Please follow the steps above, starting from the device manager, select the Spectrum card to be updated, right-click and select „Update Driver Software...“ and follow the steps above.
  • Page 30: Linux

    Unfortunately this won’t work in most cases as most Linux system refuse to load a driver which is not exactly matching. In this case it is possible to get the kernel driver sources from Spectrum. Please contact your local sales representative to get more details on this procedure.
  • Page 31: Standard Driver Update

    The matching version is installed automatically in the /usr/lib directory by the kernel driver install script for card level products. The library is renamed for easy access to libspcm_linux.so. For digitizerNETBOXgeneratorNETBOX products and also for evaluating or using only the software simulated demo cards the library is in- stalled with a separate install script: sh install_libonly.sh (c) Spectrum GmbH...
  • Page 32: Control Center

    To start programming the cards under Linux please use the standard C/C++ examples which are all running under Linux and Windows. Control Center The Spectrum Control Center is also available for Linux and needs to be installed separately. The features of the Control Center are de- scribed in a later chapter in deeper detail.
  • Page 33: Software

    Software Overview The Spectrum drivers offer you a common and fast API for using all of the board hardware features. This API is the same on all supported operating systems. Based on this API one can write own programs using any programming language that can access the driver API. This manual describes in detail the driver API, providing you with the necessary information to write your own programs.
  • Page 34: Discovery Of Remote Cards And Digitizernetbox/Generatornetbox Products

    This is the stored information that allows other Spectrum products to access previously found cards. Using the „Update cached cards“ button will try to re-open these cards and gather information of it. Afterwards the remote cards may disappear if they’re in use from somewhere else or the complete information of the remote products is shown again.
  • Page 35: Hardware Information

    Hardware information Through the control center you can easily get the main information about all the installed Spectrum hardware. For each installed card there is a separate tree of information available. The picture shows the information for one in- stalled card by example. This given information contains: •...
  • Page 36: Driver Information

    Card Control Center Software Driver information The Spectrum card control center also offers a way to gather information on the installed and used Spectrum driver. The information on the driver is available through a dedicated tab, as the picture is showing in the example.
  • Page 37: Performing Card Calibration

    28000000] = 112000000 Bytes/second. Taking the above figures measured on a standard 33 MHz PCI slot the system is just capable of reaching this transfer speed: 108.0 MB/s = 108 * 1024 * 1024 = 113246208 Bytes/second. Unfortunately it is not possible to measure transfer speed on a system without having a Spectrum card installed. (c) Spectrum GmbH...
  • Page 38: Debug Logging For Support Cases

    Device mapping Within the „Device mapping“ tab of the Spectrum Control Center, one can en- able the re-mapping of Spectrum devices, be it either local cards, remote instru- ments such as a digitizerNETBOX or generatorNETBOX or even cards in a remote PC and accessed via the Spectrum remote server option.
  • Page 39: Firmware Upgrade

    Spectrum. Depending on the used product and the software setup, one can use SBench as a digital stor- age oscilloscope, a spectrum analyzer, a logic analyzer or simply as a data recording front end. Different export and import formats allow the use of SBench 6 together with a variety of other programs.
  • Page 40: C/C++ Driver Interface

    Contains all error codes used with the Spectrum driver. All error codes that can be given back by any of the driver functions are also described here shortly all. The error codes and their meaning are described in detail in the appendix of this manual.
  • Page 41: Microsoft Visual C++ 64 Bit

    To access the driver, the driver functions must be loaded from 64 bit the driver dll. Most compiler offer special tools to generate a matching library (e.g. Borland offers the implib tool that generates a matching library out of the windows driver dll). If such a tool is available it is (c) Spectrum GmbH...
  • Page 42: National Instruments Labwindows/Cvi

    = (SPCM_VCLOSE*) GetProcAddress (hDLL, "spcm_vClose"); National Instruments LabWindows/CVI Include Drivers To use the Spectrum driver under LabWindows/CVI it is necessary to first load the functions from the driver dll. Please use the library file spcm_win32_cvi.lib to access the driver functions. Examples Examples for LabWindows/CVI can be found on CD in the directory /examples/cvi.
  • Page 43 The board must first be initialized by the spcm_hOpen function. The parameter lRegister must have a valid software register constant as defined in the regs.h file. The available software registers for the driver are listed in the board specific part (c) Spectrum GmbH...
  • Page 44 Driver functions Software of the documentation below. The function returns a 32 bit error code if an error occurs. If no error occurs the function returns ERR_OK, what is zero. Function spcm_dwGetParam uint32 _stdcall spcm_dwGetParam_i32 ( // Return value is an error code drv_handle hDevice, // handle to an already opened device...
  • Page 45 Call this function if you want to delete the buffer memory after calling the spcm_dwDefTransfer function. If the buffer already has been transferred after calling spcm_dwDefTransfer it is not necessary to call this function. When calling spcm_dwDefTransfer any further defined buffer is automatically invalidated. (c) Spectrum GmbH...
  • Page 46 Driver functions Software Function spcm_dwInvalidateBuf uint32 _stdcall spcm_dwInvalidateBuf ( // invalidate the transfer buffer drv_handle hDevice, // handle to an already opened device uint32 dwBufType); // type of the buffer to invalidate as // listed above under SPCM_BUF_XXXX Function spcm_dwGetErrorInfo The function returns complete error information on the last error that has occurred.
  • Page 47: Borland Delphi (Pascal) Programming Interface

    Besides including the driver files in the project it is also necessary to include them in the uses section of the source files where functions or constants should be used: uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, SpcRegs, SpcErr, spcm_win32; (c) Spectrum GmbH...
  • Page 48: Examples

    The example implements a very simple scope program that makes single acquisitions on button pressing. A fixed setup is done inside the example. The spcm_scope example can be used with any analog data acquisition card from Spectrum. It covers cards with 1 byte per sample...
  • Page 49: Visual Basic Programming Interface And Examples

    To use the driver function and all the defined constants it is necessary to include the files into the project as shown in the picture on the right. The project overview is taken from one of the examples delivered on CD. (c) Spectrum GmbH...
  • Page 50: Examples

    The example implements a very simple scope program that makes single acquisitions on button pressing. A fixed setup is done inside the example. The spcm_scope example can be used with any analog data acquisition card from Spectrum. It covers cards with 1 byte per sample...
  • Page 51: Net Programming Languages

    Library For using the driver with a .NET based language Spectrum delivers a special library that encapsulates the driver in a .NET object. By adding this object to the project it is possible to access all driver functions and constants from within your .NET environment.
  • Page 52: Using Managed C++/Cli

    .NET programming languages Software Using Managed C++/CLI The SpcmDrv.NET.dll needs to be included within the project options. Please select „Project“ - „Properties“ - „References“ and finally „Add new Reference“. After this all functions and constants of the driver object are available. Please see the example in the directory CppCLR as a start: // ----- open card ----- hDevice = Drv::spcm_hOpen("/dev/spcm0");...
  • Page 53: Python Programming Interface And Examples

    # use cdll because all driver access functions use cdecl calling convention under linux spcmDll = cdll.LoadLibrary ("libspcm_linux.so") # the loading of the driver access functions is similar to windows: # load spcm_hOpen spcm_hOpen = getattr (spcmDll, "spcm_hOpen") spcm_hOpen.argtype = [c_char_p] spcm_hOpen.restype = drv_handle # ... (c) Spectrum GmbH...
  • Page 54: Examples

    Python Programming Interface and Examples Software file regs.py The regs.py file defines all constants that are used for the driver. The constant names are the same names compared to the C/C++ examples. All constant names will be found throughout this hardware manual when certain aspects of the driver usage are explained. It is recommended to only use these constant names for better readability of the programs: SPC_M2CMD = 100l # write a command...
  • Page 55: Programming The Board

    (!hDrv) // check whether we can access the card return -1; spcm_dwGetParam_i32 (hDrv, SPC_PCITYP, &lCardType); // simple command, read out of card type printf (“Found card M2i/M3i/M4i.%04x in the system\n”, lCardType & TYP_VERSIONMASK); spcm_vClose (hDrv); return 0; (c) Spectrum GmbH...
  • Page 56: Initialization

    Initialization Programming the Board Initialization Before using the card it is necessary to open the kernel device to access the hardware. It is only possible to use every device exclusively using the handle that is obtained when opening the device. Opening the same device twice will only generate an error code. After ending the driver use the device has to be closed again to allow later re-opening.
  • Page 57: Gathering Information From The Card

    One of the following values is returned, when reading this register. Each card has its own card type constant defined in regs.h. Please note that when reading the card information as a hex value, the lower word shows the digits of the card name while the upper word is a indication for the used bus type. (c) Spectrum GmbH...
  • Page 58: Hardware Version

    Hardware version Since all of the boards from Spectrum are modular boards, they consist of one base board and one or two piggy-back front-end modules and eventually of an extension module like the star-hub. Each of these three kinds of hardware has its own version register. Normally you do not need this information but if you have a support question, please provide the revision together with it.
  • Page 59: Maximum Possible Sampling Rate

    The card is physically mounted within a digitizerNETBOX. SPCM_FEAT_REMOTESERVER 10000h Support for the Spectrum Remote Server option is installed on this card. SPCM_FEAT_CUSTOMMOD_MASK F0000000h The upper 4 bit of the feature register is used to mark special custom modifications. This is only used if the card has been specially customized.
  • Page 60: Miscellaneous Card Information

    Gathering information from the card Programming the Board The following example demonstrates how to read out the custom modification code. spcm_dwGetParam_i32 (hDrv, SPC_PCIFEATURES, &lFeatures); lCustomMod = (lFeatures >> 28) & 0xF; if (lCustomMod != 0) printf("Custom modification no. %d is installed.", lCustomMod); Installed extended Options and Features Starting with the cards of the M4i series, some cards can optionally have advanced features installed.
  • Page 61 V %d.%d build %d\n”,lKernelVersion >> 24, (lKernelVersion >> 16) & 0xff, lKernelVersion & 0xffff); printf("Library V %d.%d build %d\n”,lLibVersion >> 24, (lLibVersion >> 16) & 0xff, lLibVersion & 0xffff); This small program will generate an output like this: Kernel V 1.11 build 817 Library V 1.1 build 854 (c) Spectrum GmbH...
  • Page 62: Reset

    Reset Every Spectrum card can be reset by software. Concerning the hardware, this reset is the same as the power-on reset when starting the host computer. In addition to the power-on reset, the reset command also brings all internal driver settings to a defined default state. A software reset is automatically performed, when the driver is first loaded after starting the host system.
  • Page 63: Analog Inputs

    Channel Selection One key setting that influences all other possible settings is the channel enable register. An unique feature of the Spectrum cards is the pos- sibility to program the number of channels you want to use. All on-board memory can then be used by these activated channels.
  • Page 64: Setting Up The Inputs

    Setting up the inputs Analog Inputs Setting up the inputs This analog acquisition board uses separate input stages and converters on each channel. This gives you the possibility to set up the desired and concerning your application best suiting input range also separately for each channel. All input stage related settings can easily be set by the corresponding input registers.
  • Page 65: Read Out Of Input Features

    Please note that the input features are read out for the currently selected read AI path done by register SPC_READAIPATH. Please also note that the following table shows all input features settings that are available throughout all Spectrum acquisition cards. Some of these features are not installed on your specific hardware.
  • Page 66: Input Termination

    500); // Set up channel1 to the range of ± 0.5 V Input termination The Spectrum analog acquisition cards of the M3i series offer an input path with fixed 50 ohm termination (HF path, 50 ohm path) as well as a second input path with all features to be programmed by the user (buffered path).
  • Page 67: Enhanced Status Register

    As all settings are temporarily stored in the driver, the automatic adjustment will only affect these values. After exiting your program, all cal- ibration information will be lost. To give you a possibility to save your own settings, most Spectrum card have at least one set of user settings that can be saved within the on-board EEPROM.
  • Page 68: Acquisition Modes

    Overview Acquisition modes Acquisition modes Your card is able to run in different modes. Depending on the selected mode there are different registers that each define an aspect of this mode. The single modes are explained in this chapter. Any further modes that are only available if an option is installed on the card is doc- umented in a later chapter.
  • Page 69: Card Status

    Description SPC_M2STATUS read only Reads out the current status information M2STAT_CARD_PRETRIGGER Acquisition modes only: the pretrigger area has been filled. M2STAT_CARD_TRIGGER The first trigger has been detected. M2STAT_CARD_READY The card has finished its run and is ready. (c) Spectrum GmbH...
  • Page 70: Acquisition Cards Status Overview

    Commands Acquisition modes Acquisition cards status overview The following drawing gives you an overview of the card commands and card status information. After start of card with M2CMD_CARD_START the card is acquiring pretrigger data until one time complete pretrigger data has been acquired. Then the status M2STAT_CARD_PRETRIGGER is set.
  • Page 71 The ABA mode is only available on analog acquisition cards. SPCM_BUF_TIMESTAMP 3000 Buffer is used to read out timestamp information. Details on this mode are described in the chapter about the times- tamp option. The timestamp mode is only available on analog or digital acquisition cards. (c) Spectrum GmbH...
  • Page 72: Standard Single Acquisition Mode

    The standard single mode is the easiest and mostly used mode to acquire analog data with a Spectrum acquisition card. In standard single recording mode the card is working totally independent from the PC, after the card setup is done. The advantage of the Spectrum boards is that regardless to the system usage the card will sample with equidistant time intervals.
  • Page 73: Card Mode

    Programs the number of samples to be acquired before the trigger event detection SPC_SEGMENTSIZE 10010 read/write Length of segments to acquire. SPC_LOOPS 10020 read/write Number of segments to acquire in total. If set to zero the FIFO mode will run continuously until it is stopped by the user. (c) Spectrum GmbH...
  • Page 74: Difference To Standard Single Acquisition Mode

    FIFO Single acquisition mode Acquisition modes The total amount of samples per channel that is acquired can be calculated by [SPC_LOOPS * SPC_SEGMENTSIZE]. Please stick to the below mentioned limitations of the registers. Difference to standard single acquisition mode The standard modes and the FIFO modes differ not very much from the programming side. In fact one can even use the FIFO mode to get the same behavior like the standard mode.
  • Page 75: Buffer Handling

    The register holds the current fill size of the on-board memory (FIFO buffer) in promille (1/1000) of the full on-board memory. Please note that the hardware reports the fill size only in 1/16 parts of the full memory. The reported fill size is therefore only shown in 1000/16 = 63 promille steps. (c) Spectrum GmbH...
  • Page 76 Buffer handling Acquisition modes Directly after start of transfer the SPC_DATA_AVAIL_USER_LEN is every time zero as no data is available for the user and the SPC_DATA_AVAIL_CARD_LEN is every time identical to the length of the defined buffer as the complete buffer is available for the card for transfer.
  • Page 77 // our do function gets a pointer to the start of the available data section and the length vDoSomething (&pcData[lBytesPos], lAvailBytes); // the buffer section is now immediately set available for the card spcm_dwSetParam_i32 (hDrv, SPC_DATA_AVAIL_CARD_LEN, lAvailBytes); while (!dwError); // we loop forever if no error occurs (c) Spectrum GmbH...
  • Page 78 Buffer handling Acquisition modes Buffer handling example for transfer from PC to card char* pcData = new char[lBufferSizeInBytes]; // before starting transfer we ned to once fill complete buffer memory with data vDoGenerateData (&pcData[0], lBufferSizeInBytes); // we now define the transfer buffer with the minimum notify size of on page = 4 kByte spcm_dwDefTransfer_i64 (hDrv, SPCM_BUF_DATA, SPCM_DIR_PCTOCARD , 4096, (void*) pcData, 0, lBufferSizeInBytes);...
  • Page 79: Data Organisation

    Converting ADC samples to voltage values The Spectrum driver also contains a register that holds the value of the decimal value of the full scale representation of the installed ADC. This value should be used when converting ADC values (in LSB) into real-world voltage values, because this register also automatically takes any specialities into account, such as slightly reduced ADC resolution with reserved codes for gain/offset compensation.
  • Page 80: Clock Generation

    This optional second Quartz 2 is for special customer needs, either for a special direct sampling clock or as a very precise reference for the PLL. Please feel free to contact Spectrum for your special needs. The Quarz 2 clock footprint can be equipped with a wide variety of clock sources that are available on the market.
  • Page 81: Details On The Different Clock Modes

    In some cases it is necessary to use a special high precision frequency for sampling rate generation. For these applications all cards of the M3i/M4i series can be equipped with a special customer quartz. Please contact Spectrum for details on available oscillators. If your card is...
  • Page 82: External Clock (Reference Clock)

    Details on the different clock modes Clock generation External clock (reference clock) The external clock input is fed through a PLL to the clock system. Therefore the input will act as a reference clock input thus allowing to either use a copy of the external clock or to generate any sampling clock within the allowed range from the reference clock. Please note the limited setup granularity in comparison to the internal sampling clock generation.
  • Page 83: Trigger Modes And Appendant Registers

    Trigger modes and appendant registers General Description The trigger modes of the Spectrum M3i series A/D cards are very extensive and give you the possibility to detect nearly any trigger event you can think of. You can choose between more than 10 external trigger modes and up to 20 internal trigger modes (on analog acquisition cards) including software and channel trigger, depending on your type of board.
  • Page 84: Multi Purpose I/O Lines

    Multi Purpose I/O Lines Trigger modes and appendant registers Multi Purpose I/O Lines The M3i series has two multi purpose I/O lines that can be used for a wide variety of functions to help the interconnection with external equipment. The functionality of these multi purpose I/O lines can be software programmed and each of these lines can either be used for input or output.
  • Page 85: Special Behaviour Of Trigger Output

    • Base Ctrl firmware version V6 (or newer) • M3i.21xx cards : Modul Ctrl firmware version V1 (or newer) • M3i.32xx cards : Modul Ctrl firmware version V6 (or newer) • M3i.41xx cards : Modul Ctrl firmware version V6 (or newer) (c) Spectrum GmbH...
  • Page 86: Trigger Masks

    Trigger masks Trigger modes and appendant registers Trigger masks Trigger OR mask The purpose of this passage is to explain the trigger OR mask (see left figure) and all the appendant software registers in detail. The OR mask shown in the overview before as one object, is separat- ed into two parts: a general OR mask for external trigger (external analog and multi purpose TTL trigger) and software trigger and a channel OR mask.
  • Page 87: Trigger And Mask

    Ext2 trigger (SPCM_X1_MODE=SPCM_XMODE_TRIGIN). The card will trigger when the programmed condition for this input is valid. The following example shows, how to setup the AND mask, for an external trigger. As an example a simple high level detection has been (c) Spectrum GmbH...
  • Page 88: Software Trigger

    // Setting up ch0 trigger for HIGH levels Software trigger The software trigger is the easiest way of triggering any Spectrum board. The acquisition or replay of data will start immediately af- ter starting the board. The only delay results from the time the board needs for its setup.
  • Page 89: Trigger Delay

    (hDrv, SPC_M2CMD, M2CMD_CARD_DISABLETRIGGER); // Trigger engine is disarmed. Trigger delay All of the Spectrum M3i series cards allow the user to program an additional trigger delay. As shown in the trigger overview section, this delay is the last element in the trigger chain. Therefore the user does not have to care for the sources when programming the trigger delay.
  • Page 90: External (Analog) Trigger

    External (analog) trigger Trigger modes and appendant registers External (analog) trigger The M3i series has one main external trigger input consisting of an input stage with programmable termination and programmable AC/ DC coupling and two comparators that can be programmed in the range of +/- 5000 mV.
  • Page 91: Trigger Input Coupling

    This edge triggered external trigger mode correspond to the trigger possibilities of usual oscilloscopes. Register Value Direction set to Value SPC_TRIG_EXT0_MODE 40510 read/write SPC_TM_POS SPC_TRIG_EXT0_LEVEL0 42320 read/write Set it to the desired trigger level in mV (c) Spectrum GmbH...
  • Page 92 External (analog) trigger Trigger modes and appendant registers Trigger on negative edge The trigger input is continuously sampled with the selected sample rate. If the programmed trigger level is crossed by the trigger signal from higher values to lower values (falling edge) then the trigger event will be detected.
  • Page 93 Register Value Direction set to Value SPC_TRIG_EXT0_MODE 40510 read/write SPC_TM_NEG | SPC_TM_REARM 01000002h SPC_TRIG_EXT0_LEVEL0 42320 read/write Defines the re-arm level in mV SPC_TRIG_EXT0_LEVEL1 42330 read/write Set it to the desired trigger level in mV (c) Spectrum GmbH...
  • Page 94 External (analog) trigger Trigger modes and appendant registers Window trigger for entering signals The trigger input is continuously sampled with the selected sample rate. The upper and the lower level define a win- dow. Every time the signal enters the window from the out- side, a trigger event will be detected.
  • Page 95 Register Value Direction set to Value SPC_TRIG_EXT0_MODE 40510 read/write SPC_TM_OUTSIDEWIN 00000100h SPC_TRIG_EXT0_LEVEL0 42320 read/write Set it to the upper trigger level in mV SPC_TRIG_EXT0_LEVEL1 42330 read/write Set it to the lower trigger level in mV (c) Spectrum GmbH...
  • Page 96: External (Ttl) Trigger Using Multi Purpose I/O Connectors

    External (TTL) trigger using multi purpose I/O connectors Trigger modes and appendant registers External (TTL) trigger using multi purpose I/O connectors The M3i card series has two additional multi purpose lines that can be programmed as additional TTL trigger inputs to be combined ei- ther with the main (analog) external trigger or with some of the chan- nel trigger modes explained later in this manual.
  • Page 97 Sets the trigger mode for multi purpose X0 trigger input. SPC_TRIG_EXT2_MODE 40512 read/write Sets the trigger mode for multi purpose X1 trigger input. SPC_TM_LOW Sets the trigger mode for external TTL trigger to detect LOW levels. (c) Spectrum GmbH...
  • Page 98: Channel Trigger

    Channel Trigger Trigger modes and appendant registers Positive and negative TTL trigger (both edges) This mode is for detecting the rising and falling edges of an ex- ternal TTL signal. The board will trigger on the first rising or falling edge that is detected after starting the board.
  • Page 99: Channel Trigger Level

    0 is set to the the ±200 mV range. The decimal value for SPC_TRIG_CH0_LEVEL0 corresponds then with 16.0 mV, which is the resulting trigger level. spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_MODE, SPC_TM_POS); // Setting up channel trig (rising edge) spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH0_LEVEL0, 40); // Sets triggerlevel to 16.0 mV spcm_dwSetParam_i32 (hDrv, SPC_TRIG_CH_ORMASK0, SPC_TMASK0_CH0); // and enable it within the OR mask (c) Spectrum GmbH...
  • Page 100: Detailed Description Of The Channel Trigger Modes

    Reading out the number of possible trigger levels The Spectrum driver also contains a register that holds the value of the maximum possible different trigger levels considering the above men- tioned exclusion of the most negative possible value. This is useful, as new drivers can also be used with older hardware versions, because you can check the trigger resolution during run time.
  • Page 101 SPC_TM_NEG | SPC_TM_REARM 01000002h SPC_TRIG_CH0_LEVEL0 42200 read/write Defines the re-arm level relatively to the channels’s input range board dependent SPC_TRIG_CH0_LEVEL1 42300 read/write Set it to the desired trigger level relatively to the channel’s input range. board dependent (c) Spectrum GmbH...
  • Page 102 Channel Trigger Trigger modes and appendant registers Channel window trigger for entering signals The analog input is continuously sampled with the selected sample rate. The upper and the lower level define a win- dow. Every time the signal enters the window from the out- side, a trigger event will be detected.
  • Page 103 00000100h SPC_TRIG_CH0_LEVEL0 42200 read/write Set it to the upper trigger level relatively to the channel’s input range. board dependent SPC_TRIG_CH0_LEVEL1 42300 read/write Set it to the lower trigger level relatively to the channel’s input range. board dependent (c) Spectrum GmbH...
  • Page 104: Mode Multiple Recording

    Recording modes Mode Multiple Recording Mode Multiple Recording The Multiple Recording mode allows the acquisition of data blocks with multiple trigger events without restarting the hard- ware. The on-board memory will be divided into several segments of the same size. Each segment will be filled with data when a trig- ger event occurs (acquisition mode).
  • Page 105: Limits Of Pre Trigger, Post Trigger, Memory Size

    The trigger counter feature needs at least driver version V2.17 and firmware version V20 (M2i series), V10 (M3i series) or V6 (M4i series). Please update the driver and the card firmware to these versions to use this feature. Trying to use this feature without the proper firmware version will issue a driver error. (c) Spectrum GmbH...
  • Page 106: Programming Examples

    Programming examples Mode Multiple Recording Using the trigger counter information one can determine how many Multiple Recording segments have been acquired and can perform a memory flush by issuing Force trigger commands to read out all data. This is helpful if the number of trigger events is not known at the start of the acquisition.
  • Page 107: Timestamps

    // setting timestamp mode to start reset mode using internal clocking spcm_dwSetParam_i32 (hDrv, SPC_TIMESTAMP_CMD, SPC_TSMODE_STARTRESET | SPC_TSCNT_INTERNAL | SPC_TSFEAT_NONE); // setting timestamp mode to standard using external reference clock with positive edge spcm_dwSetParam_i32 (hDrv, SPC_TIMESTAMP_CMD, SPC_TSMODE_STANDARD | SPC_TSCNT_REFCLOCKPOS | SPC_TSFEAT_NONE); (c) Spectrum GmbH...
  • Page 108: Timestamp Modes

    Timestamp modes Timestamps Timestamp modes Standard mode In standard mode the timestamp counter is set to zero once by writing the TS_RESET commando to the command register. After that command the counter counts continuously independent of start and stop of acquisition. The timestamps of all recorded trigger events are referenced to this common zero time.
  • Page 109: Refclock Mode

    // and print the start date and time information (European format: day.month.year hour:minutes:seconds) printf ("Start date: %02d.%02d.%04d\n", lSyncDate & 0xff, (lSyncDate >> 8) & 0xff, (lSyncData >> 16) & 0xffff); printf ("Start time: %02d:%02d:%02d\n", (lSyncTime >> 16) & 0xff, (lSyncTime >> 8) & 0xff, lSyncTime & 0xff); (c) Spectrum GmbH...
  • Page 110: Reading Out The Timestamps

    Reading out the timestamps Timestamps Reading out the timestamps General The timestamps are stored in an extra FIFO that is located in hardware on the card. This extra FIFO can read out timestamps using DMA transfer similar to the DMA transfer of the main sample data DMA transfer. The card has two completely independent busmaster DMA engines in hardware allowing the simultaneous transfer of both timestamp and sample data.
  • Page 111 However it is not necessary to use the wait functions and one can simply request the current status whenever the program has time to do so. When using this polling mode the announced available (c) Spectrum GmbH...
  • Page 112: Data Transfer Using Polling

    Reading out the timestamps Timestamps bytes still stick to the defined notify size! • If the on-board FIFO buffer has an overrun data transfer is stopped immediately. Buffer handling example for DMA timestamp transfer (ABA transfer is similar, just using other registers) char* pcData = new char[lBufSizeInBytes];...
  • Page 113: Comparison Of Dma And Polling Commands

    BaseXIO digital inputs. The following table shows the resulting 64 bit timestamps. Timestamp Mode byte byte byte byte byte byte byte byte Standard / StartReset XIO7…XIO0 56 bit wide Timestamp Refclock mode XIO7…XIO0 24 bit wide Refclock edge counter (seconds counter) 32bit wide sample counter (c) Spectrum GmbH...
  • Page 114: Combination Of Memory Segmentation Options With Timestamps

    Combination of Memory Segmentation Options with Timestamps Timestamps The BaseXIO-Data sampling option requires the option BaseXIO to be installed. All enhanced timestamps are no longer sign extended integer 64 values so that before using these stamps for calculations (such as calcu- lating the difference between two stamps) one has to mask out the leading byte of the stamps first.
  • Page 115: Example Multiple Recording And Timestamps

    M3i: driver version V2.06 (or newer) and firmware version V6 (or newer) Please update your system to the newest versions to run this mode. The programming details of the ABA mode and timestamp modes are each explained in a dedicated chapter in this manual. (c) Spectrum GmbH...
  • Page 116: Aba Mode (Dual Timebase)

    General information ABA mode (dual timebase) ABA mode (dual timebase) General information The ABA mode allows the acquisition of data with a dual timebase. In case of trigger event the inputs are sampled very fast with the pro- grammed sampling rate. This part is similar to the Multiple Recording option. But instead of having no data in between the segments one has the opportunity to continuously sample the inputs with a slower sampling rate the whole time.
  • Page 117: Fifo Mode

    Please keep in mind that this table shows all values at once. Only the absolute maximum and minimum values are shown. There might be additional limitations. Which of these values is programmed depends on the used mode. Please read the detailed documentation of the mode. (c) Spectrum GmbH...
  • Page 118: Example For Setting Aba Mode

    Reading out ABA data ABA mode (dual timebase) Example for setting ABA mode: The following example will program the standard ABA mode, will set the fast sampling rate to 100 MHz and acquire 2k segments with 1k pretrigger and 1k posttrigger on every rising edge of the trigger input. Meanwhile the inputs are sampled continuously with the ABA mode with a ABA divider set to 5000 resulting in a slow sampling clock for the A area of 100 MHz / 5000 = 20 kHz: // setting the fast sampling clock as internal 100 MHz spcm_dwSetParam_i32 (hDrv, SPC_CLOCKMODE, SPC_CM_INTPLL);...
  • Page 119: Data Transfer Using Dma

    However it is not necessary to use the wait functions and one can simply request the current status whenever the program has time to do so. When using this polling mode the announced available (c) Spectrum GmbH...
  • Page 120: Data Transfer Using Polling

    Reading out ABA data ABA mode (dual timebase) bytes still stick to the defined notify size! • If the on-board FIFO buffer has an overrun data transfer is stopped immediately. Buffer handling example for DMA timestamp transfer (ABA transfer is similar, just using other registers) char* pcData = new char[lBufSizeInBytes];...
  • Page 121: Comparison Of Dma And Polling Commands

    Enables storage of one additional timestamp for the first A area sample (B time base related) in addition to the trigger related timestamps. SPC_TSFEAT_NONE No additional timestamp is created. The total number of stamps is only trigger related. (c) Spectrum GmbH...
  • Page 122 Reading out ABA data ABA mode (dual timebase) This mode is compatible with all existing timestamp modes. Please keep in mind that the timestamp counter is running with the B area time- base. // normal timestamp setup (e.g. setting timestamp mode to standard using internal clocking) uint32 dwTimestampMode = (SPC_TSMODE_STANDARD | SPC_TSMODE_DISABLE);...
  • Page 123: Option Basexio

    Sets the direction of the lower group (bit D3…D0) to input. XD_CH1_INPUT Sets the direction of the upper group (bit D7…D4) to input. XD_CH0_OUTPUT Sets the direction of the lower group (bit D3…D0) to output. XD_CH1_OUTPUT Sets the direction of the upper group (bit D7…D4) to output. (c) Spectrum GmbH...
  • Page 124: Special Input Functions

    Different functions Option BaseXIO Special Input Functions Some of the BaseXIO lines can be used in special functions, which requires the respective of the above mentioned groups of four lines (XIO3…XIO0) or (XIO4…XIO7) to be set as input. The upper group can be programmed to be either input or output, when only using the timestamp reference option and thus only uses one input in the lower group: •...
  • Page 125: Electrical Specifications

    This special sampling feature requires the option Timestamp to be installed. Electrical specifications The electrical specifications of the BaseXIO inputs and outputs can be found either in the technical data section of this manual or in the datasheet. (c) Spectrum GmbH...
  • Page 126: Option Star-Hub (M3I And M4I Only)

    Star-Hub introduction Option Star-Hub (M3i and M4i only) Option Star-Hub (M3i and M4i only) Star-Hub introduction The purpose of the Star-Hub is to extend the number of channels available for acquisition or generation by interconnecting multiple cards and running them simultaneously. The Star-Hub option allows to synchronize several cards of the same M3i/M4i series that are mounted within one host system (PC): •...
  • Page 127 (hSync, SPC_SYNC_READ_SYNCCOUNT, &lSyncCount); for (i = 0; i < lSyncCount; i++) spcm_dwGetParam_i32 (hSync, SPC_SYNC_READ_CARDIDX0 + i, &lCardIdx); printf ("star-hub logical index %d is connected with card %d\n“, i, lCardIdx); (c) Spectrum GmbH...
  • Page 128: Setup Of Synchronization

    Software Interface Option Star-Hub (M3i and M4i only) In case of 4 cards in one system and all are connected with the star-hub this program except will return: star-hub logical index 0 is connected with card 0 star-hub logical index 1 is connected with card 1 star-hub logical index 2 is connected with card 2 star-hub logical index 3 is connected with card 3 Let’s see a more complex example with two Star-Hubs and one independent card in one system.
  • Page 129: Run The Synchronized Cards

    Using one of the wait commands for the star-hub will return as soon as the card holding the star-hub has reached this state. However when synchronizing cards with different memory sizes there may be other cards that still haven’t reached this level. (c) Spectrum GmbH...
  • Page 130: Sh-Direct: Using The Star-Hub Clock Directly Without Synchronization

    Software Interface Option Star-Hub (M3i and M4i only) SH-Direct: using the Star-Hub clock directly without synchronization Starting with driver version 1.26 build 1754 it is possible to use the clock from the star-hub just like an external clock and running one or more cards totally independent of the synchronized card.
  • Page 131: Option Remote Server

    Accessing remote cards To detect remote card(s) from the client PC, start the Spectrum Control Center on the client and click "Netbox Discovery". All discovered cards will be listed under the "Remote" node. Using remote cards instead of using local ones is as easy as using a digitizerNETBOX and only requires a few lines of code to be changed compared to using local cards.
  • Page 132: Appendix

    Error Codes Appendix Appendix Error Codes The following error codes could occur when a driver function has been called. Please check carefully the allowed setup for the register and change the settings to run the program. error name value (hex) value (dec.) error description ERR_OK...
  • Page 133: Error Codes

    207h The card that has been found in the system seems to be a valid Spectrum card of a type that is supported by the driver but the driver did not find this special type internally. Please get the latest driver from http://www.spectrum-instrumentation.com and install this one.
  • Page 134: Continuous Memory For Increased Data Transfer Rate

    Speed advantage Setup on Windows systems The continuous buffer settings is done with the Spectrum Control Center us- ing a setup located on the „Support“ page. Please fill in the desired con- tinuous buffer settings as MByte. After setting up the value the system needs to be restarted as the allocation of the buffer is done during system boot time.
  • Page 135: Usage Of The Buffer

    SPCM_DIR_CARDTOPC , 0, pvData, 0, 2 * lMemsize); spcm_dwSetParam_i32 (hDrv, SPC_M2CMD, M2CMD_DATA_STARTDMA | M2CMD_DATA_WAITDMA); // ... Use the data here for analysis/calculation/storage // delete our own buffer in case we have created one if (qwContBufLen < (2 * lMemsize)) delete[] pvData; (c) Spectrum GmbH...
  • Page 136: Details On M3I Cards I/O Lines

    Details on M3i cards I/O lines Multi Purpose I/O Lines The MMCX Multi Purpose I/O connec- tors (X0 and X1) of the M3i cards from Spectrum are protected against over voltage conditions. For this purpose clamping diodes of the types 1N4148 are used in conjunction with a series resistor.

Table of Contents