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

Clarification on intended behaviour of AveragerProgram.trigger() #153

Open
Cameron-Spence-Riverlane opened this issue Jun 21, 2023 · 3 comments

Comments

@Cameron-Spence-Riverlane
Copy link
Contributor

Hi,
I am trying to understand the API, and I have encountered something that seems to be either a bug or unintended behaviour. (ZCU216, latest distribution)

from qick import QickSoc
from qick import AveragerProgram

soc = QickSoc()

cfg = {"reps" : 1}
prog = AveragerProgram(soc, cfg)

pulse_time = prog.us2cycles(1)
prog.trigger(None, pins=[0], t=0, width=pulse_time)

Pin PMOD_0 is activated briefly (long enough to see on a multimeter) when trigger is called. From my understanding the expected behaviour is that prog.trigger() adds the trigger command to an asm program, which is only actually read by the device when calling an acquire or similar method. Here it appears that the trigger happens immediately; or, at some point in this script, the PMOD pin is activated unintentionally. Can you clarify if that is the case?

Thanks!

@Cameron-Spence-Riverlane Cameron-Spence-Riverlane changed the title Clarification on intended behaviour of prog.trigger() Clarification on intended behaviour of AveragerProgram.trigger() Jun 21, 2023
@meeg
Copy link
Collaborator

meeg commented Jun 23, 2023

Your understanding is correct, and it is strange that you're seeing a pulse even though your example never executes the program, or even uploads it to the FPGA - as you say, that would be done by acquire.

Maybe the pulse you're seeing is nothing to do with your program, it is happening when you initialize QickSoc()? That loads the firmware onto the FPGA, so you expect some transients as the FPGA boots. You should step through your example code to see which line is actually making the pulse. If you can look at it on a scope you could also see if it's the pulse you expect, or something longer (I wouldn't expect a typical multimeter to see a microsecond pulse).

@Lufter
Copy link

Lufter commented May 6, 2024

Hi All,
As a follow-up, I am wondering if external triggering through PMOD is only implemented for ADC. Is there a way to implement a similar functionality to the DACs with just pynq, without goining into VHDL? In our specific applications, we usually wish to trigger the DAC instead of the ADC to output a signal at a specific time specified. Thanks!

@meeg
Copy link
Collaborator

meeg commented May 7, 2024

I think you're misunderstanding what trigger() does - it is used to trigger a readout buffer and/or output a pulse on a PMOD pin: https://qick-docs.readthedocs.io/en/latest/_autosummary/qick.asm_v1.html#qick.asm_v1.QickProgram.trigger. It does not trigger a readout based on an incoming pulse to a PMOD pin.

You can set the QICK to wait for an incoming pulse on a PMOD pin before starting a program: https://qick-docs.readthedocs.io/en/latest/_autosummary/qick.qick_asm.html#qick.qick_asm.AcquireMixin.acquire, also #137 But that may not do everything you want.

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

No branches or pull requests

3 participants