forked from M-Labs/artiq
ad9910: fix pll timeout loop
Signed-off-by: Robert Jördens <rj@quartiq.de>
This commit is contained in:
parent
4269d5ad5c
commit
d3ad2b7633
|
@ -166,17 +166,19 @@ class AD9910:
|
||||||
self.cpld.io_update.pulse(1*us)
|
self.cpld.io_update.pulse(1*us)
|
||||||
if blind:
|
if blind:
|
||||||
delay(100*ms)
|
delay(100*ms)
|
||||||
return
|
else:
|
||||||
# Wait for PLL lock, up to 100 ms
|
# Wait for PLL lock, up to 100 ms
|
||||||
for i in range(100):
|
for i in range(100):
|
||||||
sta = self.cpld.sta_read()
|
sta = self.cpld.sta_read()
|
||||||
lock = urukul_sta_pll_lock(sta)
|
lock = urukul_sta_pll_lock(sta)
|
||||||
delay(1*ms)
|
delay(1*ms)
|
||||||
if lock & (1 << self.chip_select - 4):
|
if lock & (1 << self.chip_select - 4):
|
||||||
return
|
break
|
||||||
|
if i >= 100 - 1:
|
||||||
raise ValueError("PLL lock timeout")
|
raise ValueError("PLL lock timeout")
|
||||||
if self.sync_delay_seed >= 0:
|
if self.sync_delay_seed >= 0:
|
||||||
self.tune_sync_delay(self.sync_delay_seed)
|
self.tune_sync_delay(self.sync_delay_seed)
|
||||||
|
delay(1*ms)
|
||||||
|
|
||||||
@kernel
|
@kernel
|
||||||
def power_down(self, bits=0b1111):
|
def power_down(self, bits=0b1111):
|
||||||
|
|
Loading…
Reference in New Issue