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

Determining if an edge was rise or fall from gate_both #639

Open
vontell opened this issue Dec 8, 2016 · 3 comments
Open

Determining if an edge was rise or fall from gate_both #639

vontell opened this issue Dec 8, 2016 · 3 comments

Comments

@vontell
Copy link

vontell commented Dec 8, 2016

The gate_both(self, duration) method, or _set_sensitivity(3) configuration for a TTLInOut object returns timestamps at which a rising or falling edge has been detected. However, is there any way to determine if the edge was a rise or fall, such as a tag which gets sent with the timestamp?

@sbourdeauducq
Copy link
Member

It's alternating rises and falls, so all you really need is the initial value. What do you need that for?

Sorry, something went wrong.

@vontell
Copy link
Author

vontell commented Dec 8, 2016

My current approach is also to use the initial value. However, how would I get this initial value; is there a TTLInOut method which would allow me to query the current input state of the channel? desired functionality is at issue vontell/artiq-control#7

Sorry, something went wrong.

@sbourdeauducq
Copy link
Member

In 3.x you can use this:
https://m-labs.hk/artiq/manual-master/_modules/artiq/coredevice/ttl.html#TTLInOut.sample_input
But doing what you want without any race condition is not completely straightforward (e.g. what happens if an edge arrives at the same time as when you are sampling the first time?)

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants