From 105068ad90df0a0e09a8cea47257b6190a257d4d Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Wed, 25 Apr 2018 15:19:49 +0000 Subject: [PATCH] suservo: fix restart timing --- artiq/gateware/suservo/servo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/gateware/suservo/servo.py b/artiq/gateware/suservo/servo.py index c40e7c318..10599b5a6 100644 --- a/artiq/gateware/suservo/servo.py +++ b/artiq/gateware/suservo/servo.py @@ -26,7 +26,7 @@ class Servo(Module): self.start = Signal() t_restart = t_cycle - t_adc assert t_restart > 0 - cnt = Signal(max=t_restart) + cnt = Signal(max=t_restart + 1) cnt_done = Signal() token = Signal(2) self.done = Signal() @@ -44,7 +44,7 @@ class Servo(Module): cnt.eq(cnt - 1), ), If(self.adc.start, - cnt.eq(t_restart - 1), + cnt.eq(t_restart), ), If(self.adc.done, token[0].eq(0)