background image

http://www.spincore.com

PulseBlasterESR-PRO-II

VI. Appendix: C Programming with SpinAPI

About SpinAPI

SpinAPI is a control library which allows programs to be written to communicate with the PulseBlaster 

board.  The most straightforward way to interface with this library is with a C/C++ program, and the API 
definitions are described in this context.  A reference document for the API is available online at:

http://www.spincore.com/CD/spinapi/spinapi_reference/

Using C Functions to Program the PulseBlasterESR-PRO-II

A series of functions have been written to control the board and facilitate the construction of pulses.  In 

order to use these functions, the DLL (spinapi.dll), the library file (libspinapi.a for mingw, spinapilibgcc for 
borland, and spinapi.lib for msvc), the header file (spinapi.h), must be appropriately linked.  SpinCore offers a 
pre-configured compiler package (SpinAPI Tools) that is already set up for easy compilation of new pulse 
programs.  To download SpinCore's pre-configured compiler package see the link below.  If you wish to use 
your own compiler, you may look at our SpinAPI compilation instructions document also available at the link 
below:

http://www.spincore.com/support/spinapi/

Listed below are the necessary functions that you will need to use to program your PulseBlasterESR-

PRO-II.  Be sure to include spinapi.h in your source code in order to use these functions.  Note: these 
functions are also documented in the SpinAPI Reference Documents available at the previously mentioned 
URL.

int pb_init();

Initializes PulseBlaster board. Needs to be called before calling any functions using the PulseBlaster.
Returns a negative number on an error or 0 on success.

int pb_close();

Releases PulseBlaster board. Needs to be called as last command in pulse program. Returns a
negative number on an error or 0 on success.

int pb_outp(unsigned int address, char data)

This function is used to control the board. The 

char data 

is set to zero for all instructions except for 

the last instruction in which 

char data

 is the byte to be sent.  The following chart explains the values 

for 

unsigned int address

:

2016/08/17

13

Содержание PulseBlasterESR-PRO-II

Страница 1: ...PulseBlasterESR PRO II PCI and CompactPCI Boards Owner s Manual SpinCore Technologies Inc http www spincore com...

Страница 2: ...inCore Technologies Inc reserves the right to make changes to the product s or information herein without notice PulseBlasterESR PRO II PulseBlasterESR PulseBlaster SpinCore and the SpinCore Technolog...

Страница 3: ...ecifications 7 Pulse Parameters 7 III Installation 8 Installing the PulseBlasterESR PRO II 8 IV Connecting to the PulseBlasterESR PRO II 9 Connector Information 9 BNC Connectors 9 IDC Headers 10 HWTRI...

Страница 4: ...PulseBlasterESR PRO II example3_8bit 14 example4_24bit 15 example5_24bit 15 reset 15 trigger 15 Example Use of C Functions 16 Related Products and Accessories 18 Contact Information 18 Document Inform...

Страница 5: ...urations or gaps as short as one clock period Pulse sequences attributes can be configured in any combination of the one clock period resolution see Figure 1 for example pulse sequences Figure 1 below...

Страница 6: ...will step through each memory location and output the desired pulse sequence Once the last programmed memory location has been reached the device will loop back to the start of the pulse sequence Out...

Страница 7: ...k resistor Summary PulseBlasterESR PRO II is a versatile multichannel high performance pulse pattern TTL signal generator It can operate at speeds of up to 250 MHz and is capable of generating pulse s...

Страница 8: ...ket securely with a screw 3 Plug the power cord back in turn on the computer and follow the installation prompts We recommend running example programs after you installed the PulseBlasterESR to verify...

Страница 9: ...to the PCI If using a high input impedance oscilloscope to monitor the PulseBlasterESR PRO II s output via the BNC connectors place a resistor that matches the characteristic impedance of the transmi...

Страница 10: ...lag12 23_Out On each IDC header the top row of pins 14 26 are grounds and signals are carried on bottom pins 1 13 of each header Each pin on an IDC header corresponds to a bit in the flag field of an...

Страница 11: ...for hardware triggering HW_Trigger and resetting HW_Reset Pins 1 and 2 are the reset and trigger inputs respectively and pins 3 and 4 are grounds Both inputs are pulled high by an on board 10 k pull u...

Страница 12: ...cking Rebuild All see Figure 8 below You can get this compiler on our website at http www spincore com CD Setup SpinCore_SpinAPI_Tools_2007_07_11 exe Making changes to an example program requires unde...

Страница 13: ...oad SpinCore s pre configured compiler package see the link below If you wish to use your own compiler you may look at our SpinAPI compilation instructions document also available at the link below ht...

Страница 14: ...ncluded SpinAPI Programs Included in the PBESR PRO II directory of the SpinAPI package default installation location C Program Files SpinCore Examples PulseBlasterESR PRO II are several example progra...

Страница 15: ...he end of your cable example5_24bit This example program demonstrates the ability to change outputs every clock period NOTE It is important to terminate all signals properly i e with a 50 Ohm terminat...

Страница 16: ...m pulse sequence onto the PulseBlasterESR PRO II board and then triggers it This is a high speed output function that will not work for any other PulseBlaster or RadioProcessor board include stdio h i...

Страница 17: ...000000001 4 768 us pb_inst_hs24 000000000000000000000010 2 0 us pb_inst_hs24 000000000000000000000100 2 0 us pb_inst_hs24 000000000000000000000010 2 0 us pb_inst_hs24 000000000000000000000100 2 0 us p...

Страница 18: ...ming synchronization between the cores For more information please visit http www spincore com products PulseBlasterESR_MultiCore PulseBlasterESR_MultiCore shtml 3 If you require an Oven Controlled Cl...

Отзывы: