Skip to content
Snippets Groups Projects

Apsct ad9511

1 file
+ 11
10
Compare changes
  • Side-by-side
  • Inline
+ 11
10
@@ -246,7 +246,6 @@ class PllClass:
#
# Read all registers on the PLL and print on screen
#
self.dev_i2c_pll.write_bytes(0x07, 0x00)
bytes_to_read = 12
ret_value = self.read_byte_pll(0, nof_bytes=bytes_to_read)
for cnt in range(bytes_to_read):
@@ -258,19 +257,21 @@ class PllClass:
#
# Read lock status
#
ret_value = self.read_byte_pll(0x00, nof_bytes=1)
status_pll = int(ret_value, 2)
if status_pll == 0x04:
if (self.frequency == '200MHz'):
i2_c_io_device = I2C(0x20, BUSNR=I2CBUSNR)
else:
i2_c_io_device = I2C(0x21, BUSNR=I2CBUSNR)
i2_c_io_device.write_bytes(0x06, 0x2C) # '0' is output
i2_c_io_device.write_bytes(0x07, 0x00) # '0' is output
ack, ret_value = i2_c_io_device_b.read_bytes(0x00, 1)
status_pll = ret_value & 0x02
if status_pll == 0x02:
self.lock = True
stri = f"PLL {self.frequency} is in lock"
elif (status_pll & 0x10) > 0:
self.lock = False
stri = f"PLL {self.frequency} Not Locked --> No 10 MHz ref"
else:
self.lock = False
stri = f"PLL {self.frequency} Not locked --> PLL Error"
if print_on:
print(stri)
stri = f"PLL {self.frequency} is not locked"
print(stri)
return self.lock
def read_lol(self):
Loading