######################## #ADI Demo Python Script ######################## #Gui Version:2.0.68 DLL Version:1.5.2.3566 Fpga Version:46000200 ArmVersion: 5.2.2 #Import Reference to the DLL import System from System import Array from System import Int16 from System import UInt32 from System import Byte from System import SByte import time import clr clr.AddReferenceToFileAndPath("C:\\Program Files (x86)\\Analog Devices\\AD9371 Transceiver Evaluation Software\\AdiCmdServerClient.dll") from AdiCmdServerClient import AdiCommandServerClient from AdiCmdServerClient import Enums from AdiCmdServerClient import MykDpdConfig from AdiCmdServerClient import MykClgcConfig from AdiCmdServerClient import MykVswrConfig from AdiCmdServerClient import TddFsmParameters_us from AdiCmdServerClient import MykonosProfileData from AdiCmdServerClient.AD9528 import AD9528Settings #Create an Instance of the Class Link = AdiCommandServerClient.Instance Mykonos = AdiCommandServerClient.Instance.Mykonos FpgaMykonos = AdiCommandServerClient.Instance.FpgaMykonos #Connect to the Zynq Platform #Connect to the Zynq Platform if(Link.hw.Connected == 1): Connect = 1 else: Connect = 0 Link.hw.Connect("192.168.1.40", 55555) #Read the Version print Link.version() Link.spiWrite(0x190, 0x03)# Enable RX1 and RX2 Channel NCO print 'Default RX FTW set' print Link.spiRead(0x191) print Link.spiRead(0x192) print Link.spiRead(0x192) #Combined with 0x192 and 0x193, these registers for a 24-bit number that sets the frequency of the NCO according to the following equation. Note that the 8 LSBs are not currently used. #Calculate FTW for Rx NCO using, F_NCO = F_(PFIR_IN)×((RX_NCO_CH1_FTW[23:8])/65536) #For example, if F_(PFIR_IN) = 245.76MHz, then the frequency tuning word (FTW) NCO would be 2048. Link.spiWrite(0x191, 0x80) #RX_NCO_CH1_FTW[23:16] Link.spiWrite(0x192, 0x00) #RX_NCO_CH1_FTW[15:8] Link.spiWrite(0x193, 0x00) #RX_NCO_CH1_FTW[7:0] print 'After setting the FTW NCO' print Link.spiRead(0x191) print Link.spiRead(0x192) print Link.spiRead(0x192) #Disconnect from the Zynq Platform if(Connect == 0): Link.hw.Disconnect()