Hi,
I am currently trying to implement my own AD9959 DDS user device through modifying the NovaTechDDS9M code in labscript_device and Matthew's AD9959ArduinoComm.
* Some background:
I am using an Arduino as an MCU for the AD9959 eval board, supplying reference clock with an Keithley AWG. I am using Prawnblaster as a pseudoclock. I plan to write my AD9959 lab script device as an intermediate device.
* What I want to achieve:
In Philip's thesis, it seems like we can do the following with the experiment logic file to control the DDS output.
# Connection Table
NovaTechDDS9M(name=’novatechdds9m_0’, parent_device=pulseblaster_0_novatech_clock, com_port=’com8’)
DDS(name=’rb_central_MOT_trap_aom’, parent_device=novatechdds9m_0, connection=’channel 1’,digital_gate={’device’:pulseblaster_0.direct_outputs,’connection’:’flag 3’})
# Experiment logic
start()
rb_central_MOT_trap_aom.enable(t)
rb_central_MOT_trap_aom.setfreq(t,rb_central_MOT_trap_frequency * MHz)
rb_central_MOT_trap_aom.setamp(t,rb_central_MOT_trap_amplitude / 1023.0)
t+=10
rb_central_MOT_trap_aom.disable(t)
t+=1
stop(r)
I assume the above code will enable the DDS output at time t with output duration of 10 seconds. I wish to implement those functions in experiment logic part with my AD9959 if possible.
* Current Status:
The good news is that I can update all the channels in manual state (program_manual, in blacs_workers.py and blacs_tabs.py ). I am now trying to modify the generate_code() method in lab script_device.py and transition_to_buffer() in blacs_workers.py code as attached. But I soon figured out my DDS could't output at the correct timing while running the experiment logic script.
First of all I've not yet figure out how to TTL trigger each channel separately on AD9959 eval board. I assume sending TTL high at the assigned time t though DDS.enable() will enable the channel output on the correct clock tick provided by the pseudolock. I am planning to send out digital trigger through one of the DigitalOut from NI 6733, but unsure which pin I should connect to on the eval board.
Second, I noticed that in the original implementation of the NovaTechDDS9M, we are packaging the output_table into the h5 shot file. My understanding is that output_table is an array, where each of its element is the output values that we want to send to the AnalogOut when the clock clicks. In transition_to_buffer() there is a loop that will unpackaged the shot file and go through the output_table and write registers to control the DDS. But I think my code just directly loop through the entire table as fast as it can no matter how the clock clicks. So I am wondering how pseudo clocks actually works in this case?
I am wondering if anybody has comment on those two issues. Anything will be very much appreciated!
Best,
Chun-Wei