http://www.spincore.com
PulseBlasterESR-PRO-II
Example Use of C Functions
This example code will generate the pulses shown in the timing diagram on page 5 using a 250MHz
model. An equivalent program is included with the SpinAPI package and is named “example4_24bit.”
/* PulseBlasterESR-PRO-II high speed memory output Example program
* © 2009 SpinCore Technologies Inc.
*
http://www.spincore.com
*
* This sample code is available to SpinCore customers to use and modify for any
* purpose, including commercial use.
*
* For more information visit:
*
http://www.spincore.com/products/PulseBlasterESR-PRO-II/
*
* This program loads a custom 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>
#include <stdlib.h>
#include <string.h>
#include "spinapi.h"
#define CLOCK 250.0
int detect_boards();
int select_board(int numBoards);
int main(int argc, char **argv)
{
int numBoards;
printf("Using SpinAPI library version %s\n", pb_get_version());
if((numBoards = detect_boards()) > 1)
{
/*If there is more than one board in the system, have the user
specify.*/
select_board(numBoards); /*Request the board number to use from the
user*/
}
if (pb_init () != 0)
{
printf ("Error initializing board: %s\n", pb_get_error ());
system("pause");
return -1;
}
//setup the clock frequency
pb_core_clock(CLOCK);
//The following two lines are used for PBESR-Pro-II designs in place of
2016/08/17
16