This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMX2594: Missing Register definitions in datasheet

Part Number: LMX2594


I am working on implementing Frequency control over our LMX2594 part using the 2594EVM board as my test set. I have my micro connected to the SPI bus and am able to communicate and command the LMX2594. But I don't seem to be getting the same results as the TICS Pro Software. I have put a logic analyzer on the SPI bus between the Reference Pro board that comes with the EVM, and the LMX2594EVM board. Specifically, the TICS Pro SW writes R31 for which I have no documentation in the datasheet. The datasheet says to just set it to 0x1F43EC and does not provide any field definitions for this register. TICS Pro, writes this register to 0x1F0000 when defaulting TICS Pro to 7000MHz output. if there is something I am missing I would appreciate the help. I am simply trying to tune the LMX2594 on 1MHz steps for the full frequency range.

Currently, I cannot achieve lock without using the TICS Pro SW to lock the board. I know there is the "how-to-tune" in the datasheet but it does not cover all of the various scenarios in the chip. Any help in getting a tuning plan would also be appreciated.


Thank you,

Brandon Smith

  • Dear Brandon, thank you for reaching out. I have assigned this to an engineer who will verify the issue you are reporting, regards, simon.
  • Brandon,

    TICSPro and the datasheet both give the details of the registers, but in situations where they just give hard numbers to program, they should match. I confirm that indeed TICSPro says to program 0x1F43EC but the ne newest datasheet on page 38 matches TICSPro. So TICSPro is correct. Are you using the most recent August 2017 datasheet?

    Register R31 has information that sets internal levels for the channel divider and for VCO7 and they should be fixed.

    It sounds like TICSPro is working for you, but it might not be obvious how to translate this to your code. If this is the case, then you can either go to the regsiters tab or also you can see the LMX2594 specific code by going to the install directory (or app data) in the LMX2594 file and looking at the LMX2594_PLL.py file.

    Regards,
    Dean
  • Hi, thank you, I found the updated datasheet. But, I cannot find the Python file you speak of. all that is in my install dir for TICSPro is DLLs some config files, log files, a pdf and the application. Could you lead me to where this python file might be? Thank you.
  • Brandon,

    If you install something to the Program Files directory, Winndows hides the datafile in a complety different location.

    Look here

    C:\Users\[USER_NAME]AppData\Roaming\Texas Instruments\TICS Pro

    Regards,
    Dean

  • Dean,

    There is nothing in that folder but an empty folder named "Devices" (again it is also empty). Is there anywhere else the files may be?

    thank you

  • """
    Copyright (C) {2015} Texas Instruments Incorporated - http://www.ti.com/ 
    ALL RIGHTS RESERVED 
    """
    
    from System.Windows.Media import SolidColorBrush, Color, Colors
    
    from System.Windows.Controls import(ComboBox,ComboBoxItem)
    from System.Windows import TextAlignment,FontWeights
    
    import sys
    import clr
    clr.AddReference("System.Windows.Forms")
    from System.Windows.Forms import DialogResult, MessageBox, MessageBoxButtons, MessageBoxIcon
    
    import math
    
    
    brush_warning = SolidColorBrush(Color.FromArgb(255,204,0,0))
    brush_white = SolidColorBrush(Color.FromArgb(255,255,255,255))
    brush_alert = SolidColorBrush(Color.FromArgb(255,253,205,52))
    
    text_grey = SolidColorBrush(Color.FromArgb(153,153,153,0))
    text_warning = SolidColorBrush(Color.FromArgb(255,204,0,0))
    text_black = SolidColorBrush(Colors.Black)
    
    # Note: In some places elements are accessed using UIC_Control (UI Control Element) because of the clash with controls in User Controls Page
    
        
    class GlobalVariables(object):
    	def __init__(self):
    		self.VCO_freq_state = "";
    g = GlobalVariables();
    
    def System_Update():
        UpdateFpdFrequency()
        UpdateVCOFrequency() 
        ValidateFrequencies()
    
    def System_Update_Loaded_Mode():
        Fpd_FREQ_Update()
        UpdateVCOFrequency() 
        ValidateFrequencies()
    
    
    def System_Update_Run_Once():
        UIC_Fpd_FREQ.TextAlignment = TextAlignment.Right
    
        UIC_flexKVCO.TextAlignment = TextAlignment.Left
        UIC_Fvco_FREQ.TextAlignment = TextAlignment.Right
        UIC_flexSYSREF_INTERPOL_FREQ.TextAlignment=TextAlignment.Right
        
        UIC_FoutA_FREQ.TextAlignment = TextAlignment.Left
        UIC_FoutB_FREQ.TextAlignment = TextAlignment.Left
        
        UIC_JESD_DAC1_CTRL.Foreground=text_grey
        UIC_JESD_DAC2_CTRL.Foreground=text_grey
        UIC_JESD_DAC3_CTRL.Foreground=text_grey
        UIC_JESD_DAC4_CTRL.Foreground=text_grey
        
        UIC_flexSYSREFPHASESHIFT.ToolTip="This is not a programmable field for the actual device, but calculates the four settings below to adjust the phase shift.  Valid values are 0 to 224."
    	
        Fpd_FREQ_Update()
        UpdateVCOFrequency() 
        ValidateFrequencies()
        
    def FCAL_EN_Update():
        if (FCAL_EN.iValue==0):
            UIC_FCAL_EN.Background=brush_alert
        else:
            UIC_FCAL_EN.Background=brush_white
            UIC_FCAL_EN.ToolTip=None
            
    def Fosc_FREQ_Update():
        UpdateInputPath()
        
    def Fosc_FREQ_Update_UI():
        ValidateFrequencies()
    
    def OSC_2X_Update():
        UpdateInputPath()
        UpdateCurrent()
        
    def OSC_2X_Update_UI():
        ValidateFrequencies()
        
    def PLL_R_PRE_Update():
        UpdateInputPath()
        UpdateCurrent()
    
    def PLL_R_PRE_Update_UI():
        ValidateFrequencies()
        
    def MULT_Update():
        UpdateInputPath()
        UpdateCurrent()
        
    def MULT_Update_UI():
        ValidateFrequencies()
    
    def PLL_R_Update():
        UpdateInputPath()
        UpdateCurrent()
    
    def PLL_R_Update_UI():
        ValidateFrequencies()
        
    def FoutA_FREQ_Update():
        #   Figure out if MUX Should be Changed
        Fout=FoutA_FREQ.dValue
        if (Fout>7499.999):
            OUTA_MUX.iValue=1
        else:
            OUTA_MUX.iValue=0
            
        if (OUTA_MUX.iValue==0):
            Divide = GetCHANDIV(CHDIV.iValue)
            Fvco = Fout*Divide
            if (Fvco>7499.9999) and (Fvco<15000.0001) and ((Fvco<11500.001) or (Divide<7)):
                Fvco_FREQ.dValue= round(Fvco,10)
            else:
                FoundMatch=0
                for i in range(0,18):
                    Divide = GetCHANDIV(i)
                    Fvco = Divide*Fout
                    if (Fvco>7499.9999) and ((Fvco<11500.001) or (Divide<7)):
                        Fvco_FREQ.dValue = round(Fvco,10)
                        CHDIV.iValue=i
                        FoundMatch=1
                        break;
                        
                if (FoundMatch==0):
                    Fvco_FREQ.dValue=7500
                    CHDIV.iValue=17
                    FoutA_FREQ.dValue=7500.0/768
        else:
            Fvco_FREQ.dValue=round(FoutA_FREQ.dValue,10)
            if (CHDIV.iValue>2) and (Fvco_FREQ.dValue>11500):
                CHDIV.iValue=0
        
        Fvco_FREQ_Update()
        UpdateCurrent()
     
    def FoutB_FREQ_Update():
        #   Figure out if MUX Should be Changed
        Fout=FoutB_FREQ.dValue
        if (Fout>7499.999):
            OUTB_MUX.iValue=1
        else:
            OUTB_MUX.iValue=0
            
        if (OUTB_MUX.iValue==0):
            Divide = GetCHANDIV(CHDIV.iValue)
            Fvco = Fout*Divide
            if (Fvco>7499.9999) and (Fvco<15000.0001) and ((Fvco<11500.001) or (Divide<7)):
                Fvco_FREQ.dValue= round(Fvco,10)
            else:
                FoundMatch=0
                for i in range(0,18):
                    Divide = GetCHANDIV(i)
                    Fvco = Divide*Fout
                    if (Fvco>7499.9999) and ((Fvco<11500.001) or (Divide<7)):
                        Fvco_FREQ.dValue = round(Fvco,10)
                        CHDIV.iValue=i
                        FoundMatch=1
                        break;
                        
                if (FoundMatch==0):
                    Fvco_FREQ.dValue=7500
                    CHDIV.iValue=17
                    FoutB_FREQ.dValue=7500.0/768
                    
        if (SYSREF_EN.iValue==1):
            SYSREF_EN.iValue=0
        if (SYSREF_REPEAT.iValue==1):
            SYSREF_REPEAT.iValue=0
        if (SYSREF_PULSE.iValue==1):
            SYSREF_PULSE.iValue=0
            
        Fvco_FREQ_Update()
        UpdateCurrent()
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        if (OUTB_MUX.iValue==0):
            Fout=FoutB_FREQ.dValue
            Divide = GetCHANDIV(CHDIV.iValue)
            Fvco = Divide*Fout
            if (Fvco>7499.9999) and ((Divide<7) or (Fvco<11500.001)):
                Fvco_FREQ.dValue= round(Fvco,10)
            else:
                FoundMatch=0
                for i in range(0,17):
                    Divide = GetCHANDIV(i)
                    Fvco = Divide*Fout
                    if (Fvco>7499.9999) and ( (Fvco<11500.001) or (Divide<7)):
                        Fvco_FREQ.dValue = round(Fvco,10)
                        CHDIV.iValue=i
                        FoundMatch=1
                        break;
                        
                if (FoundMatch==0):
                    Fvco_FREQ.dValue=7500
                    CHDIV.iValue=17
        else:
            Fvco_FREQ.dValue=round(FoutB_FREQ.dValue,10)
     
        Fvco_FREQ_Update()
        UpdateCurrent()
        
    
    def FoutA_FREQ_Update_UI():
        ValidateFrequencies()
     
    def FoutB_FREQ_Update_UI():
        ValidateFrequencies()
     
        
    def UpdateInputPath():
        PreR = PLL_R_PRE.iValue
        if (PreR<1):
            PreR=1
        MultOut = Fosc_FREQ.dValue*(OSC_2X.iValue+1)*MULT.iValue/PreR
        if (MultOut<0.000001):
            MultOut = Fosc_FREQ.iValue
            
        Rdiv=PLL_R.iValue
        if (Rdiv<1):
            Rdiv=1
    
        Fpd_FREQ.dValue=round(MultOut/Rdiv,10)
        UpdateNDivider()
        UpdateVCOFrequency() 
    
           
    def Fpd_FREQ_Update():
        Fpd = Fpd_FREQ.dValue
        if (Fpd<0.000001):
            Fpd=1
        PreR = PLL_R_PRE.iValue
        if (PreR<1):
            PreR=1
        MultOut = Fosc_FREQ.dValue*(OSC_2X.iValue+1)*MULT.iValue/PreR
        if (MultOut<0.000001):
            MultOut = Fosc_FREQ.iValue
            
        Rdiv=MultOut/Fpd
        if Rdiv>128:
            Rdiv=128      
        if Rdiv<1:
            Rdiv=1
        PLL_R.iValue=int(Rdiv+0.5)
        
        UpdateInputPath() 
        UpdateCurrent()
    
    def Fpd_FREQ_Update_UI():
        ValidateFrequencies()
       
    def PLL_NUM_Update():
        UpdateVCOFrequency() 
        UpdateCurrent()
        
    def PLL_NUM_Update_UI():
        ValidateFrequencies()
        UpdateCurrent()
    
    def PLL_DEN_Update():
        UpdateVCOFrequency() 
        UpdateCurrent()
        
    def PLL_DEN_Update_UI():
        ValidateFrequencies()
    
    def PLL_N_Update():
        UpdateVCOFrequency() 
        UpdateCurrent()
    
    def PLL_N_UPdate_UI():
        ValidateFrequencies()
        
    def CHDIV_DIV2_Update_UI():
        UpdateCurrent()
        ValidateFrequencies()
        
        
    def MASH_SYNC_EN_Update_UI():
        ValidateFrequencies()
        
    def VCO_PHASE_SYNC_EN_Update():
        UpdateIncludedDivide()
        UpdateNDivider() 
        UpdateVCOFrequency()
        UpdateVCOGain() 
        UpdateDistribution()
        
        
    def VCO_PHASE_SYNC_EN_Update_UI():
        ValidateFrequencies()
        UpdateSYNCStatus()
    
    def SYSREF_EN_Update():
        UpdateIncludedDivide()
        UpdateNDivider() 
        UpdateVCOFrequency()
        UpdateVCOGain() 
        UpdateDistribution() 
    
    def SYSREF_EN_Update_UI():
        ValidateFrequencies()   
        
    def SYSREF_REPEAT_Update_UI():
        ValidateFrequencies()
    
    def SYSREF_DIV_PRE_Update():
        UpdateNDivider() 
        UpdateVCOFrequency()
        UpdateVCOGain() 
        UpdateDistribution() 
        
    def SYSREF_DIV_PRE_Update_UI():
        ValidateFrequencies() 
    
    def SYSREF_DIV_Update():
        UpdateNDivider() 
        UpdateVCOFrequency()
        UpdateVCOGain() 
        UpdateDistribution() 
        
    def SYSREF_DIV_Update_UI():
        ValidateFrequencies() 
        
    def SYSREF_PULSE_Update_UI():
        ValidateFrequencies()
       
    
    def VCO_SEL_Update():
        ValidateFrequencies()
        
    
    def UpdateVCOFrequency():
        Fden=PLL_DEN.iValue
        TotalR=PLL_R_PRE.iValue*PLL_R.iValue
        if (TotalR<1):
            TotalR=1
        TotalMult=(1+OSC_2X.iValue)*MULT.iValue
        if (TotalMult<1):
            TotalMult=1
        #   Be cautions to use calculations that do not cause round-off error problems or VCO frequency
        if (Fden<1):
            Fden=1
        TotalN=1.0*PLL_N.iValue+PLL_NUM.iValue*1.0/Fden
        Fvco_FREQ.dValue=round(TotalMult*flexINCLUDED_DIVIDE.iValue*TotalN*Fosc_FREQ.dValue/TotalR,10)
        
        UpdateVCOGain()
        UpdateDistribution()
        UIC_FCAL_EN.Background=brush_alert
        UIC_FCAL_EN.ToolTip="The FCAL_EN bit needs to be toggled to whenever the VCO frequency is changed to activate the VCO Calibration Sequence."
        pass
    
    def Fvco_FREQ_Update():
        UpdateNDivider() 
        UpdateVCOFrequency()
        UpdateVCOGain() 
        UpdateDistribution()
        UIC_FCAL_EN.Background=brush_alert
        UIC_FCAL_EN.ToolTip="The FCAL_EN bit needs to be toggled to whenever the VCO frequency is changed to activate the VCO Calibration Sequence."
        UpdateCurrent()
       
    def Fvco_FREQ_Update_UI():
        ValidateFrequencies()
    
    def UpdateIncludedDivide():
        if (VCO_PHASE_SYNC_EN.iValue==0):
            flexINCLUDED_DIVIDE.iValue=1
        elif (SYSREF_EN.iValue==0) and (OUTA_MUX.iValue==1) and (OUTB_MUX.iValue==1):
            flexINCLUDED_DIVIDE.iValue=1
        elif (SYSREF_EN.iValue==0) and (OUTA_MUX.iValue==2) and (OUTB_MUX.iValue==1):
            flexINCLUDED_DIVIDE.iValue=1
        elif (flexSEG1.iValue % 3 == 0):
            flexINCLUDED_DIVIDE.iValue=6
        else:
            flexINCLUDED_DIVIDE.iValue=4
        
        UpdateSYSREFInterpolator();
    
    def UpdateNDivider():
        Fvco=Fvco_FREQ.dValue
        Fden=PLL_DEN.iValue
        if (Fden<1):
            Fden=1
            PLL_DEN.iValue=1
        Fpd=Fpd_FREQ.dValue
        if (Fpd<0.0000001):
            Fpd_FREQ.dValue=1
            Fpd=1
            
        PreR = PLL_R_PRE.iValue
        if (PreR<1):
            PreR=1
        MultOut = Fosc_FREQ.dValue*(OSC_2X.iValue+1)*MULT.iValue/PreR
        if (MultOut<0.000001):
            MultOut = Fosc_FREQ.iValue
            
        Rdiv=PLL_R.iValue
        if (Rdiv<1):
            Rdiv=1        
    
        #   Note, do not use Fpd_Freq as it has been rounded off and can cause an infinite loop
        FracN=Rdiv*Fvco/(MultOut*flexINCLUDED_DIVIDE.iValue)
        N=math.floor(FracN)
        PLL_N.iValue=N
        PLL_NUM.iValue=round(Fden*(FracN-N))
        
        pass    
     
       
        
    def UpdateSYSREFInterpolator():
        flexSYSREF_IncludeDivide.iValue=flexINCLUDED_DIVIDE.iValue
        DIV = flexINCLUDED_DIVIDE.iValue
        
        if (SYSREF_DIV_PRE.iValue==1) or (SYSREF_DIV_PRE.iValue==2) or (SYSREF_DIV_PRE.iValue==4):
            DIV=DIV*SYSREF_DIV_PRE.iValue
        
        if (DIV<1):
            DIV=1
        
        flexSYSREF_INTERPOL_FREQ.dValue = Fvco_FREQ.dValue/DIV
        
        
    def UpdateVCOGain():
        Fvco=Fvco_FREQ.dValue
        
        if (Fvco<7300):
            Kvco = 59
        elif (Fvco<8600):
            Kvco = 59+(89-59)*(Fvco-7500)/(8600-7500)
        elif (Fvco<9800):
            Kvco = 62+(90-62)*(Fvco-8600)/(9800-8600)        
        elif (Fvco<10800):
            Kvco = 77 +(110-77)*(Fvco-9800)/(10800-9800)
        elif (Fvco<12000):
            Kvco = 80 +(91-80)*(Fvco-10800)/(12000-10800)
        elif (Fvco<12900):
            Kvco = 149+(150-149)*(Fvco-12900)/(12900-12000)
        elif (Fvco<13900):
            Kvco = 121+(157-121)*(Fvco-12900)/(13900-12900)
        elif (Fvco<15000):
            Kvco = 127+(177-127)*(Fvco-13900)/(15000-13900)
        else:
            Kvco = 177
        flexKVCO.dValue=round(Kvco)
        
    
    def ValidateFrequencies():
        Fosc=Fosc_FREQ.dValue
        Fpd =Fpd_FREQ.dValue
        Fvco=Fvco_FREQ.dValue
    
    
        #   Validate OSCin
        if (Fosc<5):
            UIC_Fosc_FREQ.Background = brush_warning
            UIC_Fosc_FREQ.ToolTip="Minimum Fosc is 5 MHz"
        elif (Fosc>1400):
            UIC_Fosc_FREQ.Background = brush_warning
            UIC_Fosc_FREQ.ToolTip="Maximum Fosc is 1400 MHz"
        else:
            UIC_Fosc_FREQ.Background = brush_white
            UIC_Fosc_FREQ.ToolTip=None  
    
        #   Validate OSCin Doubler
        if  (OSC_2X.iValue+1)*Fosc>1400:
            UIC_OSC_2X.Background = brush_warning
            UIC_OSC_2X.ToolTip = "Maximum Input Frequency for the OSCin doubler is 700 MHz."
        else:
            UIC_OSC_2X.Background = brush_white
            
        #   Validate Multiplier  
        PreR=PLL_R_PRE.iValue
        if (0==PreR):
            PreR=1
        MultIn = (OSC_2X.iValue+1)*Fosc/PreR
        MultOut = MultIn*MULT.iValue  
             
        if  (MULT.iValue==1):
            UIC_MULT.Background = brush_white
            UIC_MULT.ToolTip=None
        elif (MULT.iValue==2):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="A Multiply value of 2 is not supported.  However this can be done with the OSCin doubler."
        elif (MULT.iValue>7):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="Multiply Values of greater than 7 are not supported." 
        elif (MultIn<30):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="Minimum input frequency to the Multiplier is 30 MHz"
        elif (MultIn>70):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="Maximum input frequency to the Multiplier is 70 MHz"
        elif (MultOut<180):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="When the multiplier is engaged, the output frequency has to be at least 180 MHz."
        elif (MultOut>250):
            UIC_MULT.Background = brush_warning
            UIC_MULT.ToolTip="When the multiplier is engaged, the output frequency can not be greater than 250 MHz."  
        else:
            UIC_MULT.Background = brush_white
            UIC_MULT.ToolTip=None
        
        #   Validate PostR Divider
        if (MultOut>250) and (PLL_R.iValue>1):
            UIC_PLL_R.GetTextBox().Background = brush_warning
            UIC_PLL_R.ToolTip="The PLL_R divider maximum input freqeuncy is 250 MHz.  The PLL_R_PRE divider needs to to reduce this input frequency."
        else:
            UIC_PLL_R.GetTextBox().Background = brush_white
            UIC_PLL_R.ToolTip=None
            
    
            
        #   Validate FCAL_LPFD_ADJ
        if (Fpd<2.5):
            TargetIndex=3
        elif (Fpd<5):
            TargetIndex=2
        elif (Fpd<10):
            TargetIndex=1
        else:
            TargetIndex=0
            
        if (FCAL_LPFD_ADJ.iValue<>TargetIndex):
            UIC_FCAL_LPFD_ADJ.Background=brush_warning
            UIC_FCAL_LPFD_ADJ.ToolTip="This value should be set to "+str(TargetIndex)+" for this phase detector frequency."
        else:
            UIC_FCAL_LPFD_ADJ.Background=brush_white
            UIC_FCAL_LPFD_ADJ.ToolTip=None   
            
            
        #   Validate FCAL_HPFD_ADJ
        if (Fpd>200):
            TargetIndex=3
        elif (Fpd>150):
            TargetIndex=2
        elif (Fpd>100):
            TargetIndex=1
        else:
            TargetIndex=0    
            
        if (FCAL_HPFD_ADJ.iValue<>TargetIndex):
            UIC_FCAL_HPFD_ADJ.Background=brush_warning
            UIC_FCAL_HPFD_ADJ.ToolTip="This value should be set to "+str(TargetIndex)+" for this phase detector frequency."
        else:
            UIC_FCAL_HPFD_ADJ.Background=brush_white
            UIC_FCAL_HPFD_ADJ.ToolTip=None       
            
        #   Validate CAL_CLK_DIV
        if (Fosc>800):
            TargetIndex=3
        elif (Fosc>400):
            TargetIndex=2
        elif (Fosc>200):
            TargetIndex=1
        else:
            TargetIndex=0    
            
        if (CAL_CLK_DIV.iValue<TargetIndex):
            UIC_CAL_CLK_DIV.Background=brush_warning
            UIC_CAL_CLK_DIV.ToolTip="For this OSCin freuqency, this value needs to be adjusted up to "+str(TargetIndex)+" for proper VCO Calibration."
        elif (CAL_CLK_DIV.iValue>TargetIndex):
            UIC_CAL_CLK_DIV.Background=brush_alert
            UIC_CAL_CLK_DIV.ToolTip="Although this setting will work, the VCO calibration time can be improved by adjusting this setting down to "+str(TargetIndex)+"."   
        else:
            UIC_CAL_CLK_DIV.Background=brush_white
            UIC_CAL_CLK_DIV.ToolTip=None       
    
    #   Check N Divider, Order, and PFD_DLY
        N=PLL_N.iValue
        Order = MASH_ORDER.iValue
        Nmin=1
        PFD_DLYnew=0
        Fvco=Fvco_FREQ.dValue  
        FpdMax=400
        
        #   Validate PLL_N, PFD_DLY, and Fpd
        if (Order==0):
            FpdMax=400
            if (Fvco<12500.00001):
                Nmin=28
                PFD_DLYnew=1
            else:
                Nmin=32
                PFD_DLYnew=2
        elif (Order==1):
            FpdMax=300
            if (Fvco<10000.01):
                Nmin=28
                PFD_DLYnew=1
            elif (Fvco<12500.00001):
                Nmin=32
                PFD_DLYnew=2
            else:
                Nmin=36
                PFD_DLYnew=3
        elif (Order==2):
            FpdMax=300
            if (Fvco<10000.00001):
                Nmin=32
                PFD_DLYnew=2
            else:
                Nmin=36
                PFD_DLYnew=3
        elif (Order==3):
            FpdMax=300
            if (Fvco<10000.00001):
                Nmin=36
                PFD_DLYnew=3
            else:
                Nmin=40
                PFD_DLYnew=4
        elif (Order==4):
            FpdMax=240
            if (Fvco<1000.00001):
                Nmin=44
                PFD_DLYnew=5
            else:
                Nmin=48
                PFD_DLYnew=6
           
        if (N<28):
            UIC_PLL_N.ToolTip="PLL_N values below 28 are not supported."
            UIC_PLL_N.GetTextBox().Background = brush_warning
            UIC_MASH_ORDER.ToolTip=None
            UIC_MASH_ORDER.Background=brush_white
        elif (N<Nmin):
            UIC_PLL_N.ToolTip="This PLL_N value is too low for this MASH_ORDER, but could be supported if the MASH_ORDER is reduced.\n\n  For this VCO Frequency and MASH_ORDER, the minimum N value is "+str(Nmin)+" and the PFD_DLY_SEL setting should be "+str(PFD_DLYnew)
            UIC_PLL_N.GetTextBox().Background = brush_alert
            UIC_MASH_ORDER.Background=brush_alert   
        else:
            UIC_PLL_N.ToolTip= None
            UIC_PLL_N.GetTextBox().Background = brush_white      
            UIC_MASH_ORDER.ToolTip=None
            UIC_MASH_ORDER.Background=brush_white
            
        if (PFD_DLY_SEL.iValue==PFD_DLYnew):
            UIC_PFD_DLY_SEL.GetTextBox().ToolTip= None
            UIC_PFD_DLY_SEL.GetTextBox().Background=brush_white
        else:
            UIC_PFD_DLY_SEL.GetTextBox().ToolTip="PFD_DLY_SEL should be changed to state " + str(PFD_DLYnew) 
            UIC_PFD_DLY_SEL.GetTextBox().Background = brush_alert
            
        #   Validate Fpd
        if (Fpd_FREQ.dValue>FpdMax):
            UIC_Fpd_FREQ.Background = brush_warning
            UIC_Fpd_FREQ.ToolTip="Maximum Phase Detector Frequency for this MASH_ORDER is "+str(FpdMax)+ " MHz"
        else:
            UIC_Fpd_FREQ.Background = brush_white
            UIC_Fpd_FREQ.ToolTip=None
        
        #   Validate OUTA_MUX
        if (OUTA_PD.iValue==1) and (OUTB_PD.iValue==0) and (OUTA_MUX.iValue<>OUTB_MUX.iValue) and (OUTB_MUX.iValue<2):
            UIC_OUTA_MUX.ToolTip="OUTA is powered down.  For minium crosstalk and current consumption, set OUTA_MUX=OUTB_MUX."
            UIC_OUTA_MUX.Background=brush_alert
        elif (OUTA_MUX.iValue==2):
            UIC_OUTA_MUX.ToolTip="OUTA_MUX=2 is an invalid state."
            UIC_OUTA_MUX.Background=brush_warning    
        else:
            UIC_OUTA_MUX.ToolTip=None
            UIC_OUTA_MUX.Background=brush_white
    
     
        #   Validate VCO Frequency
        UIC_Fvco_FREQ.Background = brush_white
        UIC_Fvco_FREQ.ToolTip=None
        if (Fvco_FREQ.dValue<7500):
            UIC_Fvco_FREQ.ToolTip="Minimum VCO Frequency is 7.5 GHz"
            UIC_Fvco_FREQ.Background = brush_warning 
        elif (Fvco_FREQ.dValue>15000):
            UIC_Fvco_FREQ.Background = brush_warning
            UIC_Fvco_FREQ.ToolTip="Maximum VCO Frequency is 15 GHz"
            
    
        #   Validate SYSREF Mux and OUTB
        if (OUTB_PD.iValue==1) and (OUTA_PD.iValue==0) and (OUTB_MUX.iValue<>OUTA_MUX.iValue) and (OUTA_MUX.iValue<2):
            UIC_OUTB_MUX.Background=brush_alert
            UIC_OUTB_MUX.ToolTip="OUTB_MUX is powered down, but is turning on unnecessary circuitry.  For minimum current consumption and to eliminate crosstalk set OUTB_MUX=OUTA_MUX."
        elif (OUTB_MUX.iValue==2) and ((SYSREF_EN.iValue==0) or (VCO_PHASE_SYNC_EN.iValue==0)):
            UIC_OUTB_MUX.Background=brush_warning
            UIC_OUTB_MUX.ToolTip = "For SYSREF to work, it is required that SYSREF_EN=1 and VCO_PHASE_SYNC_EN=1."
        else:
            UIC_OUTB_MUX.Background=brush_white
            UIC_OUTB_MUX.ToolTip=None    
            
            
        #   Validate  SYSREF
        if (SYSREF_EN.iValue==0):
            Dim(SYSREF_REPEAT)
            Dim(SYSREF_PULSE)
            Dim(SYSREF_DIV_PRE)
            Dim(SYSREF_DIV)
            Dim(SYSREF_PULSE_CNT)
            Dim(flexSYSREF_INTERPOL_FREQ)
            Dim(flexSYSREF_IncludeDivide)
            Dim(flexSYSREFPHASESHIFT)
            UIC_flexSYSREF_IncludeDivide.Foreground=text_grey
            UIC_flexSYSREF_INTERPOL_FREQ.Foreground=text_grey
            
            UIC_SYSREF_EN.Background=brush_white
            UIC_SYSREF_EN.ToolTip=None
       
        else:
            UnDim(SYSREF_REPEAT)
            UnDim(SYSREF_DIV_PRE)
            UnDim(flexSYSREF_INTERPOL_FREQ)
            UnDim(flexSYSREF_IncludeDivide)
            UnDim(flexSYSREFPHASESHIFT)
            UIC_flexSYSREF_IncludeDivide.Foreground=text_black
            UIC_flexSYSREF_INTERPOL_FREQ.Foreground=text_black
                   
            if (VCO_PHASE_SYNC_EN.iValue==0):
                UIC_SYSREF_EN.Background=brush_warning
                UIC_SYSREF_EN.ToolTip="VCO_PHASE_SYNC_EN needs to be enabled for SYSREF to work."
            elif (SYSREF_REPEAT.iValue==0) and (SYSREF_PULSE.iValue==0)and (GetPin("SysRefReq")==0):
                UIC_SYSREF_EN.Background=brush_alert
                UIC_SYSREF_EN.ToolTip="The SysRefReq pin needs to be high in master continuous mode to get an output."
            else:
                UIC_SYSREF_EN.Background=brush_white
                UIC_SYSREF_EN.ToolTip=None
    
            if (SYSREF_REPEAT.iValue==0):
                UnDim(SYSREF_DIV)  
                UnDim(SYSREF_PULSE) 
                
                if (SYSREF_PULSE.iValue==0):
                    Dim(SYSREF_PULSE_CNT)
                else:
                    UnDim(SYSREF_PULSE_CNT)
    
                if (SYSREF_DIV_PRE.iValue==1) or (SYSREF_DIV_PRE.iValue == 2) or (SYSREF_DIV_PRE.iValue==4):
                    UIC_SYSREF_DIV_PRE.ToolTip=None
                    UIC_SYSREF_DIV_PRE.Background=brush_white
                else:
                    UIC_SYSREF_DIV_PRE.ToolTip = "The only valid values for the SYSREF_DIV_PRE divider are 1, 2, and 4"
                    UIC_SYSREF_DIV_PRE.Background=brush_alert
                
                
                if (flexSYSREF_INTERPOL_FREQ.dValue>799.9999999) and (flexSYSREF_INTERPOL_FREQ.dValue<1500.0000001):
                    UIC_flexSYSREF_INTERPOL_FREQ.Foreground=text_black
                    UIC_flexSYSREF_INTERPOL_FREQ.ToolTip=None
                else:
                    UIC_flexSYSREF_INTERPOL_FREQ.Foreground=text_warning
                    UIC_flexSYSREF_INTERPOL_FREQ.ToolTip="The SYSREF phase interpolator frequency needs to be between 800 and 1500 MHz."
            else:
                Dim(SYSREF_DIV)  
                Dim(SYSREF_PULSE)            
                Dim(SYSREF_PULSE_CNT)
            
            
        #Validate Output Divider
        VCOmax = 100000
        
        if (CHDIV.iValue>2):
            VCOmax=11500
        
        if (Fvco>VCOmax):
            UIC_CHDIV.Background=brush_warning
            UIC_CHDIV.ToolTip = "The maximum VCO frequency for a channel divide of 8 or greater is 11.5 GHz."
        elif (CHDIV.iValue>15) and (VCO_PHASE_SYNC_EN.iValue==1):
            UIC_CHDIV.Background=brush_alert
            UIC_CHDIV.ToolTip = "The phase SYNC for channel divider does not work above a channel divide value of 256"
        else:
            UIC_CHDIV.Background=brush_white
            UIC_CHDIV.ToolTip=None
            
        #Validate CHDIV_DIV2 Bit
        if (CHDIV.iValue>0) and (CHDIV_DIV2.iValue==0) and ( (OUTA_MUX.iValue<>1) or (OUTB_IMUX.iValue<>1)):
            UIC_CHDIV_DIV2.Background=brush_warning
            UIC_CHDIV_DIV2.ToolTip = "CHDIV_DIV2 is not checked on the user controls, but needs to be when the channel divider is greater than two and OUTA_MUX and OUTB_MUX are not both set to 1."
        elif (CHDIV.iValue==0) and (CHDIV_DIV2.iValue==1) and ((OUTA_MUX.iValue==0) or (OUTB_MUX.iValue==0)):
            UIC_CHDIV_DIV2.Background=brush_alert
            UIC_CHDIV_DIV2.ToolTip="Current consumption and possibly far out spurs can be improved by setting CHDIV_DIV2=0 on the user controls tab."
        else:
            UIC_CHDIV_DIV2.Background=brush_white
            UIC_CHDIV_DIV2.ToolTip=None
            
        #   Validate Output Buffer
        if (OUTA_PD.iValue==0):
            UIC_FoutA_FREQ.Foreground=text_black
            UnDim(OUTA_PWR)
        else:
            UIC_FoutA_FREQ.Foreground=text_grey
            Dim(OUTA_PWR)
        
        if (OUTB_PD.iValue==0):
            if (OUTB_MUX.iValue==2) and (SYSREF_REPEAT.iValue==1):
                UIC_FoutB_FREQ.Foreground=text_grey
            else:
                UIC_FoutB_FREQ.Foreground=text_black
            UnDim(OUTB_PWR)
        else:
            UIC_FoutB_FREQ.Foreground=text_grey
            Dim(OUTB_PWR)    
            
        #   Validate SYNC and SysRefReq Pins
        if (VCO_PHASE_SYNC_EN.iValue==1) and (INPIN_IGNORE.iValue==1):
            btn_ToggleSyncPin.Background=brush_alert
            btn_ToggleSyncPin.ToolTip="INPIN_IGNORE should be set to 0 if you want to use the SYNC pin."
        else:
            btn_ToggleSyncPin.Background=brush_white
            btn_ToggleSyncPin.ToolTip=None
        if (SYSREF_EN.iValue==1) and (INPIN_IGNORE.iValue==1):
            btn_ToggleSysRefPin.Background=brush_warning
            btn_ToggleSysRefPin.ToolTip="INPIN_IGNORE should be set to 0 if you want to use SYSREF feature."
        else:
            btn_ToggleSysRefPin.Background=brush_white
            btn_ToggleSysRefPin.ToolTip=None        
    
      
    def btn_SimplifyFraction_Update_UI():
        Fnum=PLL_NUM.iValue
        Fden=PLL_DEN.iValue
        
    
        if  ((Fnum==0) or (Fden==0)):
            Fden=1
            Fnum=0
        else:      
            #   Remove 1 for Large Fraction
            if  (Fden>65536) and (Fnum%65536==0) and (Fden%65536==1):
                Fden=Fden-1
                
            Divisor = 2      
            while ( Divisor<Fnum+1):
                if (0 == (Fnum % Divisor)) and (0 == (Fden % Divisor)):
                    Fnum=Fnum/Divisor
                    Fden=Fden/Divisor
                    UpdateStatusBar("Factor of "+str(Divisor))
                else:
                    Divisor=Divisor+1
                    
            if (Fden%Fnum==0):
                Fden=Fden/Fnum
                Fnum=1
        UpdateStatusBar("Fraction Simplified to "+str(Fnum)+"/"+str(Fden));     
        PLL_DEN.iValue=Fden
        PLL_NUM.iValue=Fnum  
        
    def btn_UseLargeFraction_Update_UI():
        if (PLL_NUM.iValue>0) and (PLL_DEN.iValue>0):
            Extend = int(math.log(65536*65536.0/float(PLL_DEN.iValue),2))-1
            if Extend<1:
                Extend=1
            Extend=pow(2,Extend)
            PLL_DEN.iValue=PLL_DEN.iValue*Extend+1
            PLL_NUM.iValue=PLL_NUM.iValue*Extend 
    
    
    def btn_VCOFASTCAL_Update_UI():
        Fvco=Fvco_FREQ.dValue
        
        VCOmin=7300
        VCOmax=8500
        AmpCalMin=283
        AmpCalMax=232
        CapCtrlMin=183
        CapCtrlMax=0
        AmpCal=260
        VCOSEL=1
        CapCode=78
        
        if (Fvco<8600):
            VCOSEL=1
            VCOmin=7500
            VCOmax=8600
            AmpCalMin=299
            AmpCalMax=240
            CapCtrlMin=164
            CapCtrlMax=12
        elif (Fvco<9800):
            VCOSEL=2
            VCOmin=8600
            VCOmax=9800
            AmpCalMin=356
            AmpCalMax=247
            CapCtrlMin=165
            CapCtrlMax=16
        elif (Fvco<10800):
            VCOSEL=3
            VCOmin=9800
            VCOmax=10800
            AmpCalMin=324
            AmpCalMax=224   
            CapCtrlMin=158
            CapCtrlMax=19        
        elif (Fvco<11900):
            VCOSEL=4 
            VCOmin=10800
            VCOmax=12000
            AmpCalMin=383
            AmpCalMax=244
            CapCtrlMin=140
            CapCtrlMax=0        
        elif (Fvco<12100):
            #   Frequency Hole
            VCOSEL=4
            VCOmin=11900
            VCOmax=12100 
            AmpCalMin=100
            AmpCalMax=100  
            CapCtrlMin=0
            CapCtrlMax=0           
        elif (Fvco<12900):
            VCOSEL=5
            VCOmin=12000
            VCOmax=12900
            AmpCalMin=205
            AmpCalMax=146
            CapCtrlMin=183
            CapCtrlMax=36           
        elif (Fvco<13900):
            VCOSEL=6
            VCOmin=12900
            VCOmax=13900
            AmpCalMin=242
            AmpCalMax=163
            CapCtrlMin=155
            CapCtrlMax=6 
        else:
            VCOSEL=7
            VCOmin=13900
            VCOmax=15000
            AmpCalMin=323
            AmpCalMax=244    
            CapCtrlMin=175
            CapCtrlMax=19       
    
        CapCode=CapCtrlMin - round( (CapCtrlMin-CapCtrlMax)*(Fvco-VCOmin)/(VCOmax-VCOmin) ,0)
        AmpCal = AmpCalMin+round( (AmpCalMax-AmpCalMin)*(Fvco-VCOmin)/(VCOmax-VCOmin),0 )
        
        if (CapCode<0):
            CapCode=0
        if (CapCode>183):
            CapCode=183
        if (AmpCal<0):
            AmpCal=0
        if (AmpCal>511):
            AmpCal=511
            
        VCO_SEL.iValue=VCOSEL
        VCO_CAPCTRL_STRT.iValue=CapCode
        VCO_DACISET_STRT.iValue=AmpCal
        
    def btn_ToggleSyncPin_Update_UI(): 
        if INPIN_IGNORE.iValue==1:
            UpdateStatusBar("INPIN_IGNORE needs to be 0 so that SYNC pin is not ignored.\nSetting INPIN_IGNORE bit to 0.")
            INPIN_IGNORE.iValue=0
            
        UpdateStatusBar("Toggled SYNC Pin") 
        if (GetPin("SYNC")==1):
            SetPin("SYNC",0)
            SetPin("SYNC",1)
        else:
            SetPin("SYNC",1)
            SetPin("SYNC",0)    
    
    def btn_ToggleSysRefPin_Update_UI():  
    
        if INPIN_IGNORE.iValue==1:
            UpdateStatusBar("INPIN_IGNORE needs to be 0 so that SysRefReq pin is not ignored.\nSetting INPIN_IGNORE bit to 0.")
            INPIN_IGNORE.iValue=0
    
        UpdateStatusBar("Toggled SysRefReq Pin") 
        if (GetPin("SysRefReq")==1):
            SetPin("SysRefReq",0)
            SetPin("SysRefReq",1)
        else:
            SetPin("SysRefReq",1)
            SetPin("SysRefReq",0)
            
    def flexSYSREFPHASESHIFT_old_Update():
        if (flexSYSREFPHASESHIFT.iValue<=0):
            flexSYSREFPHASESHIFT.iValue=0
            Value=0
        elif (flexSYSREFPHASESHIFT.iValue>=251):
            flexSYSREFPHASESHIFT.iValue=251
            Value=251
        else:
            Value = flexSYSREFPHASESHIFT.iValue
        
        if (Value<64):
            JESD_DAC1_CTRL.iValue=63-Value
            JESD_DAC2_CTRL.iValue=63-JESD_DAC1_CTRL.iValue
            JESD_DAC3_CTRL.iValue=0
            JESD_DAC4_CTRL.iValue=0
        elif (Value<127):
            JESD_DAC1_CTRL.iValue=0
            JESD_DAC2_CTRL.iValue=126-Value
            JESD_DAC3_CTRL.iValue=63-JESD_DAC2_CTRL.iValue
            JESD_DAC4_CTRL.iValue=0
        elif (Value<190):
            JESD_DAC1_CTRL.iValue=0
            JESD_DAC2_CTRL.iValue=0
            JESD_DAC3_CTRL.iValue=189-Value
            JESD_DAC4_CTRL.iValue=63-JESD_DAC3_CTRL.iValue
        else:
            JESD_DAC4_CTRL.iValue=252-Value
            JESD_DAC2_CTRL.iValue=0
            JESD_DAC3_CTRL.iValue=0
            JESD_DAC1_CTRL.iValue=63-JESD_DAC4_CTRL.iValue
    
    def flexSYSREFPHASESHIFT_Update():
        if (flexSYSREFPHASESHIFT.iValue<=0):
            flexSYSREFPHASESHIFT.iValue=0
        elif (flexSYSREFPHASESHIFT.iValue>=247):
            flexSYSREFPHASESHIFT.iValue=247
    
        if flexSYSREFPHASESHIFT.iValue>224:
            Value=flexSYSREFPHASESHIFT.iValue-225
        else:
            Value = flexSYSREFPHASESHIFT.iValue+27
        
        if (Value<64):
            JESD_DAC1_CTRL.iValue=63-Value
            JESD_DAC2_CTRL.iValue=63-JESD_DAC1_CTRL.iValue
            JESD_DAC3_CTRL.iValue=0
            JESD_DAC4_CTRL.iValue=0
        elif (Value<127):
            JESD_DAC1_CTRL.iValue=0
            JESD_DAC2_CTRL.iValue=126-Value
            JESD_DAC3_CTRL.iValue=63-JESD_DAC2_CTRL.iValue
            JESD_DAC4_CTRL.iValue=0
        elif (Value<190):
            JESD_DAC1_CTRL.iValue=0
            JESD_DAC2_CTRL.iValue=0
            JESD_DAC3_CTRL.iValue=189-Value
            JESD_DAC4_CTRL.iValue=63-JESD_DAC3_CTRL.iValue
        else:
            JESD_DAC4_CTRL.iValue=252-Value
            JESD_DAC2_CTRL.iValue=0
            JESD_DAC3_CTRL.iValue=0
            JESD_DAC1_CTRL.iValue=63-JESD_DAC4_CTRL.iValue
    
    def CHDIV_Update():
        UpdateDistribution()
        
        if (VCO_PHASE_SYNC_EN.iValue==1):
            UpdateIncludedDivide()
            UpdateNDivider() 
    
        pass
        
    def CHDIV_Update_UI():
        ValidateFrequencies()
        
    def OUTA_MUX_Update():
        UpdateDistribution()
        UpdateCurrent()
        pass   
    
    def OUTB_MUX_Update():
        UpdateDistribution()
        UpdateCurrent()
        pass      
        
        
    def UpdateDistribution():
        Divide=1
        SEG1=1
        SEG2=1
        SEG3=1
    
        if (0==CHDIV.iValue):
            Divide=2
            SEG1=1
            SEG2=1
            SEG3=1
        elif (1==CHDIV.iValue):
            Divide=4
            SEG1=2
            SEG2=1
            SEG3=1        
        elif (2==CHDIV.iValue):
            Divide=6
            SEG1=3
            SEG2=1
            SEG3=1
        elif (3==CHDIV.iValue):
            Divide=8
            SEG1=2
            SEG2=2
            SEG3=1   
        elif (4==CHDIV.iValue):
            Divide=12
            SEG1=3
            SEG2=2
            SEG3=1
        elif (5==CHDIV.iValue):
            Divide=16
            SEG1=2
            SEG2=4
            SEG3=1        
        elif (6==CHDIV.iValue):
            Divide=24
            SEG1=2
            SEG2=6
            SEG3=1
        elif (7==CHDIV.iValue):
            Divide=32
            SEG1=2
            SEG2=8
            SEG3=2           
        elif (8==CHDIV.iValue):
            Divide=48
            SEG1=3
            SEG2=8
            SEG3=1
        elif (9==CHDIV.iValue):
            Divide=64
            SEG1=2
            SEG2=8
            SEG3=2        
        elif (10==CHDIV.iValue):
            Divide=72
            SEG1=3
            SEG2=6
            SEG3=2
        elif (11==CHDIV.iValue):
            Divide=96
            SEG1=3
            SEG2=8
            SEG3=2           
        if (12==CHDIV.iValue):
            Divide=128
            SEG1=2
            SEG2=8
            SEG3=4
        elif (13==CHDIV.iValue):
            Divide=192
            SEG1=2
            SEG2=8
            SEG3=6        
        if (14==CHDIV.iValue):
            Divide=256
            SEG1=2
            SEG2=8
            SEG3=8
        elif (15==CHDIV.iValue):
            Divide=384
            SEG1=3
            SEG2=8
            SEG3=8
        elif (16==CHDIV.iValue):
            Divide=512
            SEG1=2
            SEG2=8
            SEG3=16
        if (17==CHDIV.iValue):
            Divide=768
            SEG1=3
            SEG2=8
            SEG3=16
       
        
        flexSEG1.iValue=SEG1
        flexSEG2.iValue=SEG2
        flexSEG3.iValue=SEG3
            
        Fvco=round(Fvco_FREQ.dValue,10)
        Fout = round(Fvco/Divide,10)
        
        if (OUTA_MUX.iValue==0):
            FoutA_FREQ.dValue=Fout
        elif (OUTA_MUX.iValue==2):
            FoutA_FREQ.dValue=2*Fvco
        else:
            FoutA_FREQ.dValue=Fvco
         
        if (OUTB_MUX.iValue==0):
            FoutB_FREQ.dValue=Fout
        elif (OUTB_MUX.iValue==2):
            SysRefDiv=SYSREF_DIV_PRE.iValue
            if (SysRefDiv==0) or (SysRefDiv==3) or (SysRefDiv>4):
                SysRefDiv=1
           
            SysRefDiv = 2*SysRefDiv*(4+2*SYSREF_DIV.iValue)
            
            if (flexSEG1.iValue==3):
                SysRefDiv=6*SysRefDiv
            else:
                SysRefDiv=4*SysRefDiv
            
            FoutB_FREQ.dValue=round(Fvco/SysRefDiv,8)
        else:
            FoutB_FREQ.dValue=Fvco     
            
        if (SYSREF_EN.iValue==1):
            UpdateSYSREFInterpolator()
         
    def MASH_ORDER_Update_UI():
        ValidateFrequencies()
        
        
    def PFD_DLY_SEL_Update_UI():
        ValidateFrequencies()    
        
    def CAL_CLK_DIV_Update_UI():
        ValidateFrequencies()
        
    def FCAL_LPFD_ADJ_Update_UI():
        ValidateFrequencies()
        
    def FCAL_HPFD_ADJ_Update_UI():
        ValidateFrequencies()
        
    def UpdateCurrent():
        Current=-1
        if (POWERDOWN.iValue==1):
            Current=4.1
        elif (RESET.iValue==1):
            Current = 160.9
        else:
            #   Core Current Outputs Off, No Channel Divider, 100 MHz Fpd, VCO Core 7 @ 14 GHz
            if (CPG.iValue==0):
                Current = 236.6
            elif (CPG.iValue==1) or (CPG.iValue==2):
                Current=242.3
            elif (CPG.iValue==3):
                Current=244.5
            elif (CPG.iValue==4):
                Current=241.1
            elif (CPG.iValue==5) or (CPG.iValue==6):
                Current=243.5
            else:
                Current=245.7
                
            #   Modify Based on VCO 
            if (Fvco_FREQ.dValue<8450):
                Current=Current+80.6-67.2
            elif (Fvco_FREQ.dValue<9700):
                Current=Current+81.3-67.2
            elif (Fvco_FREQ.dValue<10750):
                Current=Current+78.9-67.2
            elif (Fvco_FREQ.dValue<12050):
                Current=Current+88.7-67.2
            elif (Fvco_FREQ.dValue<12850):
                Current=Current+70.5-67.2
            elif (Fvco_FREQ.dValue<13750):
                Current=Current+76.9-67.2
            else:
                Current=Current+67.2-67.2            
    
         
            #   Modify Based on Input Path   
            if (OSC_2X.iValue==1):
                Current=Current+2.1
                
            if (MULT.iValue>1):
                Current=Current+5.4
                
            #   MUXout Impact
            if (OUTA_MUX.iValue==0):
                if (OUTB_MUX.iValue==0):
                    Current=Current+31
                elif (OUTB_MUX.iValue==1):
                    Current=Current+39.1
                elif (OUTB_MUX.iValue==2):
                    Current=Current+51
                elif (OUTB_MUX.iValue==3):
                    Current=Current+47       
            elif (OUTA_MUX.iValue==1):     
                if (OUTB_MUX.iValue==0):
                    Current=Current+39.1
                elif (OUTB_MUX.iValue==2):
                    Current=Current+46.7
                elif (OUTB_MUX.iValue==3):
                    Current=Current+32.7
            elif (OUTA_MUX.iValue==2):     
                if (OUTB_MUX.iValue==0):
                    Current=Current+51.1
                elif (OUTB_MUX.iValue==1):
                    Current=Current+56.8
                elif (OUTB_MUX.iValue==2):
                    Current=Current-21
                elif (OUTB_MUX.iValue==3):
                    Current=Current+52  
            else:
                if (OUTB_MUX.iValue==0):
                    Current=Current+46.7
                else:
                    Current=Current+52.4
                    
            #   Give an 8 mA bonus for unclicking CHDIV_DIV2
            if (CHDIV_DIV2.iValue==0) and ( (OUTA_MUX.iValue%3==0) or (OUTB_MUX.iValue<>1)):
                Current=Current-8
           
            
            #   Output
            Min=58
            Mid=96.4
            Max=109.6
                
            if (OUTA_PD.iValue==0):
                Current=Current + (OUTA_PWR.iValue-31)*(OUTA_PWR.iValue-63)*Min/(0.0-31.0)/(0.0-63.0) + (OUTA_PWR.iValue-0)*(OUTA_PWR.iValue-63)*Mid/(31.0-0)/(31.0-63.0) + (OUTA_PWR.iValue-31)*(OUTA_PWR.iValue-0)*Max/(63.0-31.0)/(63.0-0.0)
            
            if (OUTB_PD.iValue==0):
                Current=Current + (OUTB_PWR.iValue-31)*(OUTB_PWR.iValue-63)*Min/(0.0-31.0)/(0.0-63.0) + (OUTB_PWR.iValue-0)*(OUTB_PWR.iValue-63)*Mid/(31.0-0)/(31.0-63.0) + (OUTB_PWR.iValue-31)*(OUTB_PWR.iValue-0)*Max/(63.0-31.0)/(63.0-0.0)
                
            if (OUTA_PD.iValue==0) and (OUTB_PD.iValue==0):
                Current=Current-5
    
        flexCurrent.dValue=round(Current)
    
        
    def OUTA_PD_Update():
        UpdateCurrent()
        ValidateFrequencies()
        
    def OUTB_PD_Update():
        UpdateCurrent()
        ValidateFrequencies()
    
    def OUTA_PWR_Update():
        UpdateCurrent()
        
    def OUTB_PWR_Update():
        UpdateCurrent()    
        
    def UpdateSYNCStatus():
        if (VCO_PHASE_SYNC_EN.iValue==1):
            M = (OSC_2X.iValue+1)*MULT.iValue
            
            if (OUTA_PD.iValue==0):
                Fout=FoutA_FREQ.dValue
            else:
                Fout=FoutB_FREQ.dValue
            
            Fosc=Fosc_FREQ.dValue
            if (Fosc<0.00001):
                Fosc=1.0
                
            Ratio  = math.floor((Fout+1e-10)/Fosc_FREQ.dValue)
            
            if (abs(Ratio*1.0-Fout/Fosc)<0.00000000001):
                TimingNonCritical=True
            else:
                TimingNonCritical=False
    
            if (CHDIV.iValue>15):
                UpdateStatusBar("Device in SYNC Category 4(SYNC not Possible):\nThis is because the channel divide is 512 or greater.")
            elif (M==1):
                if (TimingNonCritical==False):
                    UpdateStatusBar("Device in SYNC Category 3(Timed SYNC Required):\nThis is because the output frequency is not a multiple of the input frequency.\nAlso check the datasheet for limitations on the maximum input frequency.")                
                elif (CHDIV.iValue>2):
                    UpdateStatusBar("Device in SYNC Category 2(Non-Timed SYNC Required):\nSyncronization is required for the output divider, the timing is not critical.\nThis can be done with the SYNC pin with no timing concerns, or by toggling the VCO_PHASE_SYNC bit from 0 to 1.")
                else:
                    UpdateStatusBar("Device in SYNC Category 1(No SYNC Required):\nAll division is in the loop and the output is a multiple of the input frequency, so the output will always be in SYNC with the input.")            
            else:
                if (Ratio % M == 0) and (PLL_NUM.iValue==0):
                    UpdateStatusBar("Device in SYNC Category 1(No SYNC Required):\n\nAll division is in the loop and the output is a multiple of the input frequency, so the output will always be in SYNC with the input.\nIn this special case, although there multiplication in the input path and the timing for this is not determinsitic, it does not matter because all other elements are tracked out by the loop.")                
                else:
                    UpdateStatusBar("Device in SYNC Category 4(SYNC not Possible):\nSYNC is not possible because timing for multiplication in the input path is not closed and this is only possible in integer mode and with the output divider entirely in the loop.")               
    
    def GetCHANDIV(Index):
        i=int(Index)
        x=1
        if (i==0):
            x=2
        elif (i==1):
            x=4
        elif (i==2):
            x=6
        elif (i==3):
            x=8
        elif (i==4):
            x=12
        elif (i==5):
            x=16
        elif (i==6):
            x=24
        elif (i==7):
            x=32
        elif (i==8):
            x=48
        elif (i==9):
            x=64
        elif (i==10):
            x=72
        elif (i==11):
            x=96
        elif (i==12):
            x=128
        elif (i==13):
            x=192
        elif (i==14):
            x=256
        elif (i==15):
            x=384
        elif (i==16):
            x=512
        elif (i==17):
            x=768
            
        return x
    
    Brandon,

    The other place would be the install directory, assuming that it is not the program files directory.  I am attaching the file here.

  • Thank you for the file. Just a note I searched my entire computer for that filename and nothing came up. I do not think these files are shipped with TICS Pro. If there was a different download I didn't see it. I just reinstalled even to double check.
  • Brandon,

    The LMX2594 would not function without this file.  If you installed TICSPro to the program files directory, the windows virtual store puts the data in a completely different directory and this changes with the user of the computer.  Anyways, not sure why you could not find the file, but now you have it.

    Regards,
    Dean