Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functions to read and write registers on Alazar and Trigger holdoff for 9360 #1307

Merged

Conversation

jenshnielsen
Copy link
Collaborator

This is work in progress since it should probably not be merged before its used for anything

@codecov
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #1307 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1307   +/-   ##
=======================================
  Coverage   72.57%   72.57%           
=======================================
  Files          74       74           
  Lines        8473     8473           
=======================================
  Hits         6149     6149           
  Misses       2324     2324

@jenshnielsen jenshnielsen force-pushed the alazar_read_write_register branch from 2d13a31 to 22ba1eb Compare October 12, 2018 08:13
@jenshnielsen jenshnielsen changed the title [Wip] Add functions to read and write registers on Alazar [Wip] Add functions to read and write registers on Alazar and Trigger holdoff for 9360 Oct 15, 2018
@jenshnielsen
Copy link
Collaborator Author

This now has support for enabling and disabling trigger holdoff on the 3260 card. The following
code illustrates the problem. Triggering at ~200 KHz on a 20 MHz sine signal from a function generator with a trigger pulse per cycle.

import qcodes as qc
from qdev_wrappers.alazar_controllers.ATSChannelController import ATSChannelController
from qdev_wrappers.alazar_controllers.alazar_channel import AlazarChannel
from qcodes.instrument_drivers.AlazarTech.ATS9360 import AlazarTech_ATS9360


alazar = AlazarTech_ATS9360('Alazar')
myctrl = ATSChannelController(name='my_controller', alazar_name='Alazar')
# Configure all settings in the Alazar card
with alazar.syncing():    
    alazar.clock_source('INTERNAL_CLOCK')
    alazar.sample_rate(1_000_000_000)
    alazar.clock_edge('CLOCK_EDGE_RISING')
    alazar.decimation(1)
    alazar.coupling1('DC')
    alazar.coupling2('DC')
    alazar.channel_range1(.4)
    alazar.channel_range2(.4)
    alazar.impedance1(50)
    alazar.impedance2(50)
    alazar.trigger_operation('TRIG_ENGINE_OP_J')
    alazar.trigger_engine1('TRIG_ENGINE_J')
    alazar.trigger_source1('EXTERNAL')
    alazar.trigger_slope1('TRIG_SLOPE_POSITIVE')
    alazar.trigger_level1(160)
    alazar.trigger_engine2('TRIG_ENGINE_K')
    alazar.trigger_source2('DISABLE')
    alazar.trigger_slope2('TRIG_SLOPE_POSITIVE')
    alazar.trigger_level2(128)
    alazar.external_trigger_coupling('DC')
    alazar.external_trigger_range('ETR_2V5')
    alazar.trigger_delay(0)
    alazar.timeout_ticks(0)
    alazar.aux_io_mode('AUX_IN_AUXILIARY') # AUX_IN_TRIGGER_ENABLE for seq mode on
    alazar.aux_io_param('NONE') # TRIG_SLOPE_POSITIVE for seq mode on
    
# Create the acquisition controller which will take care of the data handling and tell it which 
# alazar instrument to talk to. Explicitly pass the default options to the Alazar.
# Dont integrate over samples but avarage over records
myctrl.int_delay(2e-7)
myctrl.int_time(2e-6)
print(myctrl.samples_per_record())

chan4 = AlazarChannel(myctrl, 'myrecvssamples', demod=False, average_records=False, integrate_samples=False)
myctrl.channels.append(chan4)

alazar.trigger_holdoff(False)
chan4.num_averages(1)
chan4.records_per_buffer(10)
chan4.alazar_channel('A')
chan4.prepare_channel()
# Measure this 
data4 = qc.Measure(chan4.data).run()
qc.MatPlot(data4.my_controller_myrecvssamples_data)

alazar.trigger_holdoff(True)
chan4.num_averages(1)
chan4.records_per_buffer(10)
chan4.alazar_channel('A')
chan4.prepare_channel()
# Measure this 
data4 = qc.Measure(chan4.data).run()
qc.MatPlot(data4.my_controller_myrecvssamples_data)

Produces

@jenshnielsen
Copy link
Collaborator Author

Without trigger holdoff
without_trigger_holdoff

With trigger holdoff
with_trigger_holdoff

@astafan8
Copy link
Contributor

@jenshnielsen thanks for looking into it! Perhaps, this information can be copy-pasted and pushed to the Reports repo?

@jenshnielsen jenshnielsen changed the title [Wip] Add functions to read and write registers on Alazar and Trigger holdoff for 9360 Add functions to read and write registers on Alazar and Trigger holdoff for 9360 Oct 17, 2018
@jenshnielsen
Copy link
Collaborator Author

@QCoDeS/core I think this is ready for review the report is up at QCoDeS/Reports#7

The firmware needed has been released officially yesterday

Copy link
Contributor

@astafan8 astafan8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great addition! I'll add it to 9373 when i'll be working on a driver for it

@jenshnielsen jenshnielsen merged commit 0a72b2a into microsoft:master Oct 17, 2018
@jenshnielsen jenshnielsen deleted the alazar_read_write_register branch October 17, 2018 14:50
giulioungaretti pushed a commit that referenced this pull request Oct 17, 2018
Merge: 7dd2170 8397d37
Author: Jens Hedegaard Nielsen <[email protected]>

    Merge pull request #1307 from jenshnielsen/alazar_read_write_register
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants