From 64fb1ed1febb8f01b689e491f333b53353ee7055 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Mon, 16 Jan 2017 16:01:31 +0000 Subject: [PATCH] fixed a possible Bug in PulseBlaster WAIT opcode is ignored if preceeding state is shorter than 120ns. --- .../SpinCore-PulseBlaster.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/SpinCore-PulseBlaster/SpinCore-PulseBlaster.cpp b/drivers/SpinCore-PulseBlaster/SpinCore-PulseBlaster.cpp index 8d3eb4b..5445683 100644 --- a/drivers/SpinCore-PulseBlaster/SpinCore-PulseBlaster.cpp +++ b/drivers/SpinCore-PulseBlaster/SpinCore-PulseBlaster.cpp @@ -173,18 +173,27 @@ void SpinCorePulseBlaster::run_pulse_program_w_sync(state& exp, double sync_freq prog->push_front(c); // first command: wait for monoflop on P136 up again + // the monoflop will open if ADC sample clock goes through zero voltage + // this synchronizes the start of the pulse program with the sampling clock c=prog->create_command(); c->ttls=sync_mask; c->instruction=SpinCorePulseBlaster::WAIT; c->length=shortest_pulse; prog->push_front(c); - if (0) { - // zeroth command: set sync mask in advance, sometimes necessary + + + if (1) { + + // zeroth command: pulse before WAIT opcode needs to be at least 120ns + // otherwise the WAIT is ignored and the program keeps repeating until pb_stop() + // reported to SpinCore (Contact Request 2016-12-19 at 1482143561) + // markusro: When is this necessary? (TODO) c=prog->create_command(); c->ttls=sync_mask; c->instruction=SpinCorePulseBlaster::CONTINUE; - c->length=shortest_pulse+2; + //c->length=shortest_pulse+2; // markusro: why +2 ?? + c->length=12; // markusro: why +2 ?? prog->push_front(c); } duration+=2.0*shortest_pulse/clock+1.0/sync_freq;