PulseBlasterDDS
int start, loop, sub; // define instruction labels
sub = 5; // Since we are going to jump forward in our program, we need to
// define this variable by hand. Instructions start at 0 and count up
// Instruction 0 - Jump to Subroutine at Instruction 5 in 1us
start =
pb_inst(0,0,TX_ANALOG_ON,0,RX_ANALOG_ON,0x3FF,JSR,sub,1*us);
// Instruction 1 - Beginning of Loop (Loop 3 times). Continue to next
instruction in 1us
loop =
pb_inst(0,0,TX_ANALOG_OFF,0,RX_ANALOG_OFF,0x0,LOOP,3,1*us);
// Instruction 2 - End of Loop. Return to beginning of loop or continue to
next instruction in 1us
pb_inst(0,0,TX_ANALOG_ON,0,RX_ANALOG_OFF,0x0,END_LOOP,loop,1*us);
// Instruction 3 - Stay here for (5*1us) then continue to Instruction 4
pb_inst(0,0,TX_ANALOG_OFF,0,RX_ANALOG_ON,0x0,LONG_DELAY,5,1*us);
// Instruction 4 - Branch to "start" (Instruction 0) in 1us
pb_inst(0,0,TX_ANALOG_OFF,0,RX_ANALOG_ON,0x0,BRANCH,start,1*us);
// Instruction 5 - Continue to next instruction in 2us
pb_inst(0,4,TX_ANALOG_OFF,8,RX_ANALOG_ON,0x0,CONTINUE,0,2*us);
// Instruction 6 - Return from Subroutine to Instruction 1 in 2us
pb_inst(0,8,TX_ANALOG_OFF,8,RX_ANALOG_ON,0x0,RTS,0,2*us);
// End of programming registers and pulse program
stop_programming();
// Start execution of the pulse program
start_pb();
// Release control of the PB board
pb_close();
}
9/20/200521
www.spincore.com