background image

PulseBlaster

Delay Count

The value of the Delay Count field (a 32-bit value) determines how long the current instruction should be 

executed.  The allowed minimum value of this field is 0x6 for the 32k memory models and 0x2 for the internal-
memory models.  The timing controller has a fixed delay of three clock cycles and the value that one enters 
into the Delay Count field should account for this inherent delay.

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. However, virtually all programming languages and software 
environments (including software such as LabView and Matlab) provide mechanisms for accessing the 
functionality of standard libraries such as Spinapi.

Please see the example programs for an an explanation of how to use Spinapi. A reference 

document for the API is available online at:

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

Using C Functions to Program the PulseBlaster

A series of functions have been written to control the board and facilitate the construction of pulse 

program instructions.

 
IIn 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 in the working directory of your C 
compiler

1

.

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.

void set_clock(double clock_freq);

Used to set the clock frequency of the board.  The variable 

clock_frequency

 is specified in MHz 

when no units are entered.  Valid units are MHz, kHz, and Hz.  The default clock value is 50MHz. 
You only need to call this function if you are not using a –50 board.

int start_programming(int device);

Used to initialize the system to receive programming information.  It accepts a parameter referencing 
the target for the instructions.  The only alid value for 

device

 is PULSE_PROGRAM, It returns a 0 on 

success or a negative number on an error.

1

 These functions and library files have been generated and tested with MinGW (

www.mingw.com)

, Borland 5.5 (

www.borland.com)

, MS 

Visual Studio 2003 (msdn.microsoft.com) compilers.  

http://www.spincore.com

5/19/2006

12

Summary of Contents for PulseBlaster PB24-100-32k-PCI

Page 1: ...PulseBlaster PCI Board Rev 01 Owner s Manual Models PB24 100 PCI PB24 100 32k PCI SpinCore Technologies Inc http www spincore com...

Page 2: ...gies Inc reserves the right to make changes to the product s or information herein without notice PulseBlasterDDS PulseBlaster SpinCore and the SpinCore Technologies Inc logos are trademarks of SpinCo...

Page 3: ...nstalling the PulseBlaster Driver 8 III Programming the PulseBlaster 8 The PulseBlaster Interpreter 8 IV Connecting to the PulseBlaster Board 9 Connector Information 9 DB 25 and JP300 TTL Output Signa...

Page 4: ...PulseBlaster Appendix II Sample C Program 15 Contact Information 17 http www spincore com 5 19 2006 4...

Page 5: ...is that the execution time of instructions is user programmable This feature makes the PulseBlaster processor capable of executing complex patterns at greatly varying update rates ranging from nanose...

Page 6: ...to a 50 ns pulse delay update with a 100 MHz clock The external memory models up to 32k words have a nine clock period minimum instruction cycle Instruction set PulseBlaster s design features a set of...

Page 7: ...pulse interval for 32k memory words models at 100 MHz 2 years longest pulse interval 10 ns pulse interval resolution at 100 MHz 32k instructions max memory space 512 instructions for internal memory...

Page 8: ...ter The PulseBlaster Interpreter The PulseBlaster board is now programmable via the PulseBlaster Interpreter which is a free programming utility provided by SpinCore for writing pulse programs This ea...

Page 9: ...is active pin 2 GND When a falling edge is detected e g when shorting pins 1 2 it initiates code execution This trigger will also restart execution of a program from the beginning of the code if it i...

Page 10: ...elf control by one of the fields of the instruction word the shortest being five clock cycles for 512 memory word models and the longest being 2 52 clock cycles All instructions have the same format a...

Page 11: ...tion 0 CONTINUE Ignored Program execution continues to next instruction 1 STOP Ignored Stop execution of program Note all TTL values remain from previous instruction and analog outputs turn off 2 LOOP...

Page 12: ...and facilitate the construction of pulse program instructions IIn order to use these functions the DLL spinapi dll the library file libspinapi a for mingw spinapilibgcc for borland and spinapi lib fo...

Page 13: ...to be executed Please see Table 2 for details int inst_data data to be used with the previous inst field Please see Table 2 for details int length duration of this pulse program instruction specified...

Page 14: ...rt_programming PULSE_PROGRAM Instruction 0 Continue to instruction 1 in 100ms Flags 0xFFFFFF OPCODE CONTINUE start pb_inst 0xFFFFFF CONTINUE 0 200 0 ms Instruction 1 Continue to instruction 2 in 100ms...

Page 15: ...by hand Instructions start at 0 and count up sub 5 Instruction format int pb_inst int flags int inst int inst_data int length Instruction 0 Jump to Subroutine at Instruction 4 in 1s start pb_inst 0xF...

Page 16: ...om Subroutine to Instruction 1 in 5 s pb_inst 0xF0F0F0 RTS 0 500 0 ms End of pulse program pb_stop_programming Trigger the pulse program pb_start Read the status register status pb_read_status printf...

Page 17: ...PulseBlaster Contact Information Email sales spincore com Web http www spincore com Product URL http www pulseblaster com CD PulseBlaster PCI SP2 http www spincore com 5 19 2006 17...

Reviews: