![SpinCore Technologies PulseBlaster DDS-III Скачать руководство пользователя страница 13](http://html.mh-extra.com/html/spincore-technologies/pulseblaster-dds-iii/pulseblaster-dds-iii_owners-manual_1347664013.webp)
PulseBlasterDDS
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. 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.
Using C Functions to Program the PulseBlasterDDS
A series of functions have been written to control the board and facilitate the construction of pulse
program instructions. The functions also allow the programmer to set the DDS frequency and phase
registers.
In order to use these functions, the DLL (pbd03pc.dll), the library file (pbd03pc.lib), the header files
(pbd03pc.h and pbdfuncs.h), and source file (pbdfuncs.cpp) must be in the working directory of your C
compiler
2
.
int pb_init();
Initializes PulseBlasterDDS board. Needs to be called before calling any functions using the
PulseBlasterDDS. Returns a negative number on an error or 0 on success.
int pb_close();
Releases PulseBlasterDDS 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 50MHz 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. Valid values for
device
are PULSE_PROGRAM,
FREQ_REGS, PHASE_REGS_0, and PHASE_REGS_1. PHASE_REGS_0 programs the phase
registers for the DDS output on SMA connectors labeled DAC_OUT_0 and DAC_OUT_2.
PHASE_REGS_1 programs the phase registers for the DDS output on SMA connector labeled
DAC_OUT_1. The function returns a 0 on success or a negative number on an error.
int set_freq(double freq);
Used to set the values in the frequency registers. Should only be called after start_programming
(FREQ_REGS) has been called. Registers are programmed one at a time, starting at 0 and
incrementing each time this function is called. It accepts the value for the frequency register with
a default unit of MHz. Valid units are MHz, kHz, Hz. It returns a 0 on success or a negative
number on an error.
int set_phase(double phase);
Used to set the values in the phase registers. Should only be called after start_programming
(PHASE_REGS_0) or start_programming(PHASE_REGS_1) has been called. Registers are
programmed one at a time, starting at 0 and incrementing each time this function is called. It
accepts the value for the phase register in degrees. It returns a 0 on success or a negative
number on an error.
int pb_inst(int freq, int phase_SMA_1, int tx_output_enable,
int phase_SMA_0, int rx_output_enable, int flags, int inst,
2
These functions and library files have been generated and tested with the MS Visual Studio 6 environment. Support and updated
functions/DLLs for other environments may be provided upon request if available.
9/20/200513
www.spincore.com