SpinCore Logo Home
Applications
Contact Us
Purchasing Info
About Us
Software Downloads

banner_left.jpg banner_right.jpg




Simple PulseBlaster Control Word Programming Examples


This is a guide on how to translate your pulse sequence into PulseBlaster's machine word focusing on the Output Pattern/Control Word field.  Every instruction word of the PulseBlaster describes the state of each individual output bits.  To output different pulse patterns on different output bits, a new instruction needs to be created each time there is a change in the voltages in any of the output bits. 


Pulse Sequence on Two Channels Example


Drawing a timing diagram will help in creating the pulse sequence for the PulseBlaster.
 

Figure 1:  Timing Diagram Example



In Figure 1, there is a pulse on bit 0 and a pulse on bit 1.  All the other bits (bits 2-23) are low.  Three instructions (excluding terminating instructions which are described later) are needed to output this pulse sequence on the PulseBlaster:
  1. First instruction (instruction 0) will set both bits 0 and 1 high for a duration until bit 1 is low
  2. Second instruction will set bit 0 high for a duration until bit 0 is low
  3. Third instruction will output low for all bits

Figure 2, below, has a vertical line at each instruction along with the binary representation of the Output Pattern/Control Word.

Figure 2:  Timing Diagram of Figure 1 with Vertical Lines Drawn to Denote Each Instruction



The table below, shows the Control Word values for the three instructions needed to output the pulse sequence in Figures 1 and 2.


Instruction
Control Word in
Natural Numbers

Control Word in Binary
Control Word in Decimal
Control Word in Hexadecimal
0
0 + 1
0b0000 0000 0000 0000 0000 0011
3
0x000003
1
0
0b0000 0000 0000 0000 0000 0001
1
0x000001
2

0b0000 0000 0000 0000 0000 0000
0
0x000000
Table 1:  Control Word Values in Natural Numbers, Binary, Decimal, and Hexadecimal for each Instruction in Figures 1 and 2.



Pulse Sequence on Four Channels Example

This is an example which has a pulse sequence on four channels.  Drawing a timing diagram will help in creating instructions for the PulseBlaster.  For each change in voltage for any of the output bits, an instruction reflecting the change will be needed.

In Figure 3, a vertical dashed line has been drawn at every interval in which there is a voltage change in any of the four bits.  At each vertical line, an instruction is needed.  To generate the pulse sequence shown in Figure 3, 8 instructions are needed (excluding terminating instructions).  The remaining bits (4-23) not shown in Figure 3, are all low.
 

Figure 3:  Timing Diagram Example



Below are the control word values for the 8 instructions needed to program the pulse sequence in Figure 3:


Instruction
Control Word in
Natural Numbers

Control Word in Binary
Control Word in Decimal
Control Word in Hexadecimal
0
0 + 3
0b0000 0000 0000 0000 0000 1001
9
0x000009
1
3
0b0000 0000 0000 0000 0000 1000 8
0x000008
2

0b0000 0000 0000 0000 0000 0000 0
0x000000
3
2
0b0000 0000 0000 0000 0000 0100 4
0x000004
4
1 + 3
0b0000 0000 0000 0000 0000 1010 10
0x00000A
5
3
0b0000 0000 0000 0000 0000 1000 8
0x000008
6
1 + 3
0b0000 0000 0000 0000 0000 1010 10
0x00000A
7

0b0000 0000 0000 0000 0000 0000 0
0x000000
Table 2:  Control Word Values in Natural Numbers, Binary, Decimal, and Hexadecimal for each Instruction in Figure 3.



Terminating Instructions

It is also important to terminate the pulse sequence correctly so that the PulseBlaster does not enter an undefined state.

One method to terminate the pulse sequence is to use the STOP Op Code.  The behavior of the STOP Op Code is firmware dependent and will either hold the control word on prior or current instruction, or set all bits to low.  To ensure that all bits are low at the end of the pulse sequence, add an additional instruction prior to the STOP instruction that has all bits low as shown below:

...
pb_inst(0x0, CONTINUE, 0, 1.0 * ms);
pb_inst(0x0, STOP, 0, 1.0 * ms);

pb_stop_programming();


Operational Codes

Operational Codes (OpCode) can be used to loop specific instructions, create subroutines out of a set of instructions, and more.  Please refer to your product manual for more information.




Home | Products | Applications | Contact Us | Purchasing Info | About Us | Software Downloads

© 2024 SpinCore Technologies, Inc.