Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions docs/how-to/finedelay-test.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Test the finedelay
==================

1. Plug two LVDSOUT pins to an oscilloscope and use rising edge of LVDSOUT1
as trigger.

2. Enable CLOCK1, set its period to the minimum(0.016us) and use it as input for
LVDSOUT1 and LVDSOUT2.

.. image:: ../images/finedelay_test_layout.png

3. Set oct delay and fine delay to 0 in both LVDSOUTs.

4. For LVDSOUT2, set oct delay from 1 to 7 and verify in the oscilloscope that
you get delays from 1ns to 7ns respectively, then set oct delay back to 0.

5. Read initial one ns of LVDSOUT2 and use it as a reference to test fine delay.

5.1 Set fine delay to half of initial one ns and verify in the oscilloscope
that the delay is around 500ps.

5.2 Set fine delay to a quarter of initial one ns and verify in the
oscilloscope that the delay is around 250ps.

5.3 .... Repeat halving until you reach the limit of your oscilloscope ...

6. Run a script_ that sweeps all fine delay values for each oct delay value and
observe how LVDSOUT2 gets delayed very smoothly.

.. _script: https://raw.githubusercontent.com/PandABlocks/PandABlocks.github.io/refs/heads/main/scripts/finedelay-sweep.py
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This link will become valid after merging

Binary file added docs/images/finedelay_test_layout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions scripts/finedelay-sweep.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env python
import argparse
import socket
import time


def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('host')
return parser.parse_args()


def main():
args = parse_args()
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((args.host, 8888))
for wide in range(8):
s.sendall(f'LVDSOUT2.OCT_DELAY={wide}\n'.encode())
assert s.recv(32) == b'OK\n'
time.sleep(0.5)

for wide in range(8):
s.sendall(f'LVDSOUT2.OCT_DELAY={wide}\n'.encode())
assert s.recv(32) == b'OK\n'
for fine in range(512):
s.sendall(f'LVDSOUT2.FINE_DELAY={fine}\n'.encode())
assert s.recv(32) == b'OK\n'
time.sleep(0.01)

time.sleep(1)
s.sendall('LVDSOUT2.OCT_DELAY=0\n'.encode())
s.sendall('LVDSOUT2.FINE_DELAY=0\n'.encode())
s.close()


if __name__ == '__main__':
main()
Loading