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.

LMX2492: Please post the zip of the TICS Pro GUI

Part Number: LMX2492
Other Parts Discussed in Thread: LMX2594, CODELOADER, LMX2531

Can you please post the full TICS PRO source for the LMX2492?  I have found the rampcalc.py file for the board, but I cannot find the device top-level python file.  In this other forum you posted a zip with both a ramp and pll .py file for each of the devices.  Can you please do the same for the LMX2492? 

If it is not in the zip, is there another file that you can share to show the low level commands for reading and writing registers over USB?  Is this a libusb sort of thing?  I want to build my embedded device to 1) load in the hex output file from TICS PRO, because I have effectively defined the default settings using the GUI; 2) take API-like commands from python or similar to update a few key settings and automatically adjust the LMX registers to match.  That way I can most leverage the GUI and only have to build controllers for a small number of features in the chip.  

Thanks!

P.S.  The TICS PRO gui is excellent.  Much better than your competitor offerings and is a large part of why I'm going with the TI PLL.  Great work.  I love when you develop great tools to go along with your chips.  Keep it up :]!!

  • 0743.TICSPro Automation Example.xlsmDarren,

    We are glad that you like our TICSPro file and glad that you have found the device files in iron python.  However, we can not share the raw source code as this is TI property.

    Be aware that you can automate TICSPro and call it from other programs, which might be useful to you and I am attaching an excel code that can do this.

    Regards,

    Dean

  • Dean,
    Good to talk to you again, you helped me with this board back in May.
    I don't mean I want the source of TICSPro executable, just the pll.py for the 2492 so I can see how the board is programmed in its entirety. Can you share this? I know I'll need to write my own embedded C code, I'd just like to build on what you've already done.
    Thanks,
    Darren
  • Darren,

    Unfortunately, there is no LMX2594_PLL.py file.

    In the TICSPro, we hard-coded a basic PLL architecture where we turned blocks on and off (from the previous CodeLoader) tool because we had a large number of legacy PLLs we wanted to support.   For newer devices we created the "flex GUI" like the ramp tab and used it for the PLL, but the LMX2594 is the exception where we have no PLL flex GUI code.

    Regards,

    Dean

  • I need the file for the LMX2492. Does that chip have a python file that I can see?
  • 4300.LMX2492_rampcalc.py
    """
     * Copyright (C) 2016 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 math
       
    text_grey = SolidColorBrush(Color.FromArgb(153,153,153,0))
    text_black = SolidColorBrush(Colors.Black)
    
    def System_Update_Run_Once():
    
        UIC_ACC_START.Foreground=text_grey
        UIC_VCO_START_FREQ.Foreground=text_grey
        UIC_FPD_FREQ.Foreground=text_grey
    
        UIC_RAMP_LIMITH_SGN.Foreground=text_grey
        UIC_RAMP_LIMIT_HIGH_dec.Foreground=text_grey
        UIC_RAMP_LIMIT_HIGH.Foreground=text_grey
        UIC_RAMP_LIMITL_SGN.Foreground=text_grey
        UIC_RAMP_LIMIT_LOW_dec.Foreground=text_grey
        UIC_RAMP_LIMIT_LOW.Foreground=text_grey
        
        UIC_RAMP_COMP0_SGN.Foreground=text_grey
        UIC_RAMP_CMP0_dec.Foreground=text_grey
        UIC_RAMP_CMP0.Foreground=text_grey
        UIC_RAMP_COMP1_SGN.Foreground=text_grey
        UIC_RAMP_CMP1_dec.Foreground=text_grey
        UIC_RAMP_CMP1.Foreground=text_grey 
    
        UIC_ACT_END_FREQ0.Foreground=text_grey
        UIC_ACT_END_FREQ1.Foreground=text_grey
        UIC_ACT_END_FREQ2.Foreground=text_grey
        UIC_ACT_END_FREQ3.Foreground=text_grey
        UIC_ACT_END_FREQ4.Foreground=text_grey
        UIC_ACT_END_FREQ5.Foreground=text_grey
        UIC_ACT_END_FREQ6.Foreground=text_grey
        UIC_ACT_END_FREQ7.Foreground=text_grey
       
        UIC_RAMP0_LEN.Foreground=text_grey
        UIC_RAMP1_LEN.Foreground=text_grey
        UIC_RAMP2_LEN.Foreground=text_grey
        UIC_RAMP3_LEN.Foreground=text_grey
        UIC_RAMP4_LEN.Foreground=text_grey
        UIC_RAMP5_LEN.Foreground=text_grey
        UIC_RAMP6_LEN.Foreground=text_grey
        UIC_RAMP7_LEN.Foreground=text_grey
        
        UIC_RAMP0_INC_dec.Foreground=text_grey
        UIC_RAMP1_INC_dec.Foreground=text_grey
        UIC_RAMP2_INC_dec.Foreground=text_grey
        UIC_RAMP3_INC_dec.Foreground=text_grey
        UIC_RAMP4_INC_dec.Foreground=text_grey
        UIC_RAMP5_INC_dec.Foreground=text_grey
        UIC_RAMP6_INC_dec.Foreground=text_grey
        UIC_RAMP7_INC_dec.Foreground=text_grey
    
        UIC_RAMP0_INC.Foreground=text_grey
        UIC_RAMP1_INC.Foreground=text_grey
        UIC_RAMP2_INC.Foreground=text_grey
        UIC_RAMP3_INC.Foreground=text_grey
        UIC_RAMP4_INC.Foreground=text_grey
        UIC_RAMP5_INC.Foreground=text_grey
        UIC_RAMP6_INC.Foreground=text_grey
        UIC_RAMP7_INC.Foreground=text_grey    
        
        UpdateFromPLLTab();
        
        
        
    class GlobalVariables(object):
        def __init__(self):
            self.ACC_ERR = 0.0;
            self.START_ACT_ACC = 0.0;
            self.LAST_ACT_ACC=0.0;
            self.LAST_ACT_FREQ=0.0;
            self.NEXT_RAMP=0;
    
    g = GlobalVariables();
    
    def btn_UpdateFromPLLTab_Update():
        UpdateFromPLLTab();
    
    def DES_END_FREQ0_Update():
        System_Update();
    
    def DES_END_FREQ1_Update():
        System_Update();
    
    def DES_END_FREQ2_Update():
        System_Update();
    
    def DES_END_FREQ3_Update():
        System_Update();
    
    def DES_END_FREQ4_Update():
        System_Update();
    
    def DES_END_FREQ5_Update():
        System_Update();
    
    def DES_END_FREQ6_Update():
        System_Update();
    
    def DES_END_FREQ7_Update():
        System_Update();
    
    def DURATION0_Update():
        System_Update();
    
    def DURATION1_Update():
        System_Update();
    
    def DURATION2_Update():
        System_Update();
     
    def DURATION3_Update():
        System_Update();
    
    def DURATION4_Update():
        System_Update();
        
    def DURATION5_Update():
        System_Update();
    
    def DURATION6_Update():
        System_Update();
      
    def DURATION7_Update():
        System_Update();
    
    def RAMP0_DLY_Update():
        System_Update();
    
    def RAMP1_DLY_Update():
        System_Update();
    
    def RAMP2_DLY_Update():
        System_Update();
        
    def RAMP3_DLY_Update():
        System_Update();
     
    def RAMP4_DLY_Update():
        System_Update();
    
    def RAMP5_DLY_Update():
        System_Update();
    
    def RAMP6_DLY_Update():
        System_Update();
    
    def RAMP7_DLY_Update():
        System_Update();
    
    def RAMP0_NEXT_Update():
        System_Update();
         
    def RAMP1_NEXT_Update():
        System_Update();
    
    def RAMP2_NEXT_Update():
        System_Update();
    
    def RAMP3_NEXT_Update():
        System_Update();
       
    def RAMP4_NEXT_Update():
        System_Update();
    
    def RAMP5_NEXT_Update():
        System_Update();
    
    def RAMP6_NEXT_Update():
        System_Update();
     
    def RAMP7_NEXT_Update():
        System_Update();
    
    def RAMP0_RST_Update():
        System_Update();
     
    def RAMP1_RST_Update():
        System_Update();
    
    def RAMP2_RST_Update():
        System_Update();
    
    def RAMP3_RST_Update():
        System_Update();
    
    def RAMP4_RST_Update():
        System_Update();
      
    def RAMP5_RST_Update():
        System_Update();
    
    def RAMP6_RST_Update():
        System_Update();
    
    def RAMP7_RST_Update():
        System_Update();
    
    def System_Update():
        try:
            FPD_FREQ.dValue=PDF00.dValue
            VCO_START_FREQ.dValue=PDF00.dValue*(PLL_N.iValue+(PLL_NUM.iValue*1.0/16777216));
            ACC_START.dValue=(16777216.0*PLL_N.iValue)+PLL_NUM.iValue;
            if(PDF00.dValue!=0.0): 
                ACT_START_FREQ0.dValue = -1;
                ACT_START_FREQ1.dValue = -1;
                ACT_START_FREQ2.dValue = -1;
                ACT_START_FREQ3.dValue = -1;
                ACT_START_FREQ4.dValue = -1;
                ACT_START_FREQ5.dValue = -1;
                ACT_START_FREQ6.dValue = -1;
                ACT_START_FREQ7.dValue = -1;
                ACT_END_FREQ0.dValue = -1;
                ACT_END_FREQ1.dValue = -1;
                ACT_END_FREQ2.dValue = -1;
                ACT_END_FREQ3.dValue = -1;
                ACT_END_FREQ4.dValue = -1;
                ACT_END_FREQ5.dValue = -1;
                ACT_END_FREQ6.dValue = -1;
                ACT_END_FREQ7.dValue = -1;
                
                PDF = PDF00.dValue
                if (PDF<0.00000001):
                    PDF=1.0
                    
                MaxDelay0 =(RAMP0_DLY.iValue+1)*65535.0/PDF
                if (DURATION0.dValue>MaxDelay0):
                    DURATION0.dValue = MaxDelay0
                    
                MaxDelay1 =(RAMP1_DLY.iValue+1)*65535.0/PDF
                if (DURATION1.dValue>MaxDelay1):
                    DURATION1.dValue = MaxDelay1                
                    
                MaxDelay2 =(RAMP2_DLY.iValue+1)*65535.0/PDF
                if (DURATION2.dValue>MaxDelay2):
                    DURATION2.dValue = MaxDelay2                
                    
                MaxDelay3 =(RAMP3_DLY.iValue+1)*65535.0/PDF
                if (DURATION3.dValue>MaxDelay3):
                    DURATION3.dValue = MaxDelay3
                    
                MaxDelay4 =(RAMP4_DLY.iValue+1)*65535.0/PDF
                if (DURATION4.dValue>MaxDelay4):
                    DURATION4.dValue = MaxDelay4
    
                MaxDelay5 =(RAMP5_DLY.iValue+1)*65535.0/PDF
                if (DURATION5.dValue>MaxDelay5):
                    DURATION5.dValue = MaxDelay5
                    
                MaxDelay6 =(RAMP6_DLY.iValue+1)*65535.0/PDF
                if (DURATION6.dValue>MaxDelay6):
                    DURATION6.dValue = MaxDelay6                
                    
                MaxDelay7 =(RAMP7_DLY.iValue+1)*65535.0/PDF
                if (DURATION7.dValue>MaxDelay7):
                    DURATION7.dValue = MaxDelay7                
                    
    
                RAMP0_LEN.iValue = int(round(PDF00.dValue*DURATION0.dValue/(RAMP0_DLY.iValue+1)));
                RAMP1_LEN.iValue = int(round(PDF00.dValue*DURATION1.dValue/(RAMP1_DLY.iValue+1)));
                RAMP2_LEN.iValue = int(round(PDF00.dValue*DURATION2.dValue/(RAMP2_DLY.iValue+1)));
                RAMP3_LEN.iValue = int(round(PDF00.dValue*DURATION3.dValue/(RAMP3_DLY.iValue+1)));
                RAMP4_LEN.iValue = int(round(PDF00.dValue*DURATION4.dValue/(RAMP4_DLY.iValue+1)));
                RAMP5_LEN.iValue = int(round(PDF00.dValue*DURATION5.dValue/(RAMP5_DLY.iValue+1)));
                RAMP6_LEN.iValue = int(round(PDF00.dValue*DURATION6.dValue/(RAMP6_DLY.iValue+1)));
                RAMP7_LEN.iValue = int(round(PDF00.dValue*DURATION7.dValue/(RAMP7_DLY.iValue+1)));
                g.ACC_ERR=((DES_END_FREQ0.dValue/PDF00.dValue)*16777216)-ACC_START.dValue;
                if(DURATION0.dValue!=0.0):
                    RAMP0_INC_dec.iValue=int(round(g.ACC_ERR/RAMP0_LEN.iValue));
                    if(int(RAMP0_INC_dec.iValue)<0):
                        RAMP0_INC.iValue=int(1073741824.0+RAMP0_INC_dec.iValue);
                    else:
                        RAMP0_INC.iValue= RAMP0_INC_dec.iValue;
                    g.START_ACT_ACC = float(ACC_START.dValue);
                    g.LAST_ACT_ACC = float(float(RAMP0_INC_dec.iValue*RAMP0_LEN.iValue)+float(ACC_START.dValue));
                    g.LAST_ACT_FREQ = float(PDF00.dValue*g.LAST_ACT_ACC/16777216.0);
                    ACT_END_FREQ0.dValue = g.LAST_ACT_FREQ;
                    g.NEXT_RAMP = RAMP0_NEXT.iValue;
                    ACT_START_FREQ0.dValue = VCO_START_FREQ.dValue;
                    print ACT_START_FREQ0.dValue;
                    DIRTY1=0;DIRTY2=0;DIRTY3=0;DIRTY4=0;DIRTY5=0;DIRTY6=0;DIRTY7=0;
                    flag=0;
                    try:
                        while(True):
                            if(g.NEXT_RAMP==0):
                                break;
                            elif(g.NEXT_RAMP==1):
                                if(DIRTY1!=1):
                                    DIRTY1=1;
                                    CALC_RAMP(ACT_START_FREQ1,DES_END_FREQ1,ACT_END_FREQ1,RAMP1_NEXT,RAMP1_RST,RAMP1_LEN,RAMP1_INC_dec,RAMP1_INC);
                                else:
                                    break;
                            elif(g.NEXT_RAMP==2):
                                if(DIRTY2!=1):
                                    DIRTY2=1;
                                    CALC_RAMP(ACT_START_FREQ2,DES_END_FREQ2,ACT_END_FREQ2,RAMP2_NEXT,RAMP2_RST,RAMP2_LEN,RAMP2_INC_dec,RAMP2_INC);
                                else:
                                    break;
                            elif(g.NEXT_RAMP==3):
                                if(DIRTY3!=1):
                                    DIRTY3=1;
                                    CALC_RAMP(ACT_START_FREQ3,DES_END_FREQ3,ACT_END_FREQ3,RAMP3_NEXT,RAMP3_RST,RAMP3_LEN,RAMP3_INC_dec,RAMP3_INC);
                                else:
                                    break;
                            elif(g.NEXT_RAMP==4):
                                if(DIRTY4!=1):
                                    DIRTY4=1;
                                    CALC_RAMP(ACT_START_FREQ4,DES_END_FREQ4,ACT_END_FREQ4,RAMP4_NEXT,RAMP4_RST,RAMP4_LEN,RAMP4_INC_dec,RAMP4_INC);
                                else:
                                    break;
                            elif(g.NEXT_RAMP==5):
                                if(DIRTY5!=1):
                                    DIRTY5=1;
                                    CALC_RAMP(ACT_START_FREQ5,DES_END_FREQ5,ACT_END_FREQ5,RAMP5_NEXT,RAMP5_RST,RAMP5_LEN,RAMP5_INC_dec,RAMP5_INC);
                                else:
                                    break;
                            elif(g.NEXT_RAMP==6):
                                if(DIRTY6!=1):
                                    DIRTY6=1;
                                    CALC_RAMP(ACT_START_FREQ6,DES_END_FREQ6,ACT_END_FREQ6,RAMP6_NEXT,RAMP6_RST,RAMP6_LEN,RAMP6_INC_dec,RAMP6_INC);
                                    print RAMP6_INC.iValue;
                                    print RAMP6_DLY.iValue;
                                else:
                                    break;
                            elif(g.NEXT_RAMP==7):
                                if(DIRTY7!=1):
                                    DIRTY7=1;
                                    CALC_RAMP(ACT_START_FREQ7,DES_END_FREQ7,ACT_END_FREQ7,RAMP7_NEXT,RAMP7_RST,RAMP7_LEN,RAMP7_INC_dec,RAMP7_INC);
                                else:
                                    break;
                    except Exception,e:
                        print e;
            #WriteParameter(RAMP0_LEN.codeloaderName,RAMP0_LEN.iValue);
            #WriteParameter(RAMP1_LEN.codeloaderName,RAMP1_LEN.iValue);
            #WriteParameter(RAMP2_LEN.codeloaderName,RAMP2_LEN.iValue);
            #WriteParameter(RAMP3_LEN.codeloaderName,RAMP3_LEN.iValue);
            #WriteParameter(RAMP4_LEN.codeloaderName,RAMP4_LEN.iValue);
            #WriteParameter(RAMP5_LEN.codeloaderName,RAMP5_LEN.iValue);
            #WriteParameter(RAMP6_LEN.codeloaderName,RAMP6_LEN.iValue);
            # WriteParameter(RAMP7_LEN.codeloaderName,RAMP7_LEN.iValue);
            # WriteParameter(RAMP0_INC.codeloaderName,RAMP0_INC.iValue);
            # WriteParameter(RAMP1_INC.codeloaderName,RAMP1_INC.iValue);
            # WriteParameter(RAMP2_INC.codeloaderName,RAMP2_INC.iValue);
            # WriteParameter(RAMP3_INC.codeloaderName,RAMP3_INC.iValue);
            # WriteParameter(RAMP4_INC.codeloaderName,RAMP4_INC.iValue);
            # WriteParameter(RAMP5_INC.codeloaderName,RAMP5_INC.iValue);
            # WriteParameter(RAMP6_INC.codeloaderName,RAMP6_INC.iValue);
            # WriteParameter(RAMP7_INC.codeloaderName,RAMP7_INC.iValue);
        except Exception,e:
            print e;
        pass;
        if(ACT_START_FREQ0.dValue<0):
            UIC_ACT_START_FREQ0.Foreground = text_grey;
            Dim(ACT_START_FREQ0)
            Dim(DES_END_FREQ0)
            Dim(DURATION0)
            Dim(RAMP0_DLY)
            Dim(RAMP0_INC)
            Dim(RAMP0_RST)
            Dim(RAMP0_NEXT)
            Dim(RAMP0_NEXT_TRIG)
            Dim(RAMP0_FL)
            Dim(RAMP0_FLAG)
        else:
            UIC_ACT_START_FREQ0.Foreground = text_black;
            UnDim(ACT_START_FREQ0)
            UnDim(DES_END_FREQ0)
            UnDim(DURATION0)
            UnDim(RAMP0_DLY)
            UnDim(RAMP0_INC)
            UnDim(RAMP0_RST)
            UnDim(RAMP0_NEXT)
            UnDim(RAMP0_NEXT_TRIG)
            UnDim(RAMP0_FL)
            UnDim(RAMP0_FLAG)
            
        if(ACT_START_FREQ1.dValue<0):
            UIC_ACT_START_FREQ1.Foreground = text_grey;
            Dim(ACT_START_FREQ1)
            Dim(DES_END_FREQ1)
            Dim(DURATION1)
            Dim(RAMP1_DLY)
            Dim(RAMP1_INC)
            Dim(RAMP1_RST)
            Dim(RAMP1_NEXT)
            Dim(RAMP1_NEXT_TRIG)
            Dim(RAMP1_FL)
            Dim(RAMP1_FLAG)
        else:
            UIC_ACT_START_FREQ1.Foreground = text_black;
            UnDim(ACT_START_FREQ1)
            UnDim(DES_END_FREQ1)
            UnDim(DURATION1)
            UnDim(RAMP1_DLY)
            UnDim(RAMP1_INC)
            UnDim(RAMP1_RST)
            UnDim(RAMP1_NEXT)
            UnDim(RAMP1_NEXT_TRIG)
            UnDim(RAMP1_FL)
            UnDim(RAMP1_FLAG)
            
        if(ACT_START_FREQ2.dValue<0):
            UIC_ACT_START_FREQ2.Foreground = text_grey;
            Dim(ACT_START_FREQ2)
            Dim(DES_END_FREQ2)
            Dim(DURATION2)
            Dim(RAMP2_DLY)
            Dim(RAMP2_INC)
            Dim(RAMP2_RST)
            Dim(RAMP2_NEXT)
            Dim(RAMP2_NEXT_TRIG)
            Dim(RAMP2_FL)
            Dim(RAMP2_FLAG)
        else:
            UIC_ACT_START_FREQ2.Foreground = text_black;
            UnDim(ACT_START_FREQ2)
            UnDim(DES_END_FREQ2)
            UnDim(DURATION2)
            UnDim(RAMP2_DLY)
            UnDim(RAMP2_INC)
            UnDim(RAMP2_RST)
            UnDim(RAMP2_NEXT)
            UnDim(RAMP2_NEXT_TRIG)
            UnDim(RAMP2_FL)
            UnDim(RAMP2_FLAG)
            
        if(ACT_START_FREQ3.dValue<0):
            UIC_ACT_START_FREQ3.Foreground = text_grey;
            Dim(ACT_START_FREQ3)
            Dim(DES_END_FREQ3)
            Dim(DURATION3)
            Dim(RAMP3_DLY)
            Dim(RAMP3_INC)
            Dim(RAMP3_RST)
            Dim(RAMP3_NEXT)
            Dim(RAMP3_NEXT_TRIG)
            Dim(RAMP3_FL)
            Dim(RAMP3_FLAG)
        else:
            UIC_ACT_START_FREQ3.Foreground = text_black;
            UnDim(ACT_START_FREQ3)
            UnDim(DES_END_FREQ3)
            UnDim(DURATION3)
            UnDim(RAMP3_DLY)
            UnDim(RAMP3_INC)
            UnDim(RAMP3_RST)
            UnDim(RAMP3_NEXT)
            UnDim(RAMP3_NEXT_TRIG)
            UnDim(RAMP3_FL)
            UnDim(RAMP3_FLAG)
            
        if(ACT_START_FREQ4.dValue<0):
            UIC_ACT_START_FREQ4.Foreground = text_grey;
            Dim(ACT_START_FREQ4)
            Dim(DES_END_FREQ4)
            Dim(DURATION4)
            Dim(RAMP4_DLY)
            Dim(RAMP4_INC)
            Dim(RAMP4_RST)
            Dim(RAMP4_NEXT)
            Dim(RAMP4_NEXT_TRIG)
            Dim(RAMP4_FL)
            Dim(RAMP4_FLAG)
        else:
            UIC_ACT_START_FREQ4.Foreground = text_black;
            UnDim(ACT_START_FREQ4)
            UnDim(DES_END_FREQ4)
            UnDim(DURATION4)
            UnDim(RAMP4_DLY)
            UnDim(RAMP4_INC)
            UnDim(RAMP4_RST)
            UnDim(RAMP4_NEXT)
            UnDim(RAMP4_NEXT_TRIG)
            UnDim(RAMP4_FL)
            UnDim(RAMP4_FLAG)
            
        if(ACT_START_FREQ5.dValue<0):
            UIC_ACT_START_FREQ5.Foreground = text_grey;
            Dim(ACT_START_FREQ5)
            Dim(DES_END_FREQ5)
            Dim(DURATION5)
            Dim(RAMP5_DLY)
            Dim(RAMP5_INC)
            Dim(RAMP5_RST)
            Dim(RAMP5_NEXT)
            Dim(RAMP5_NEXT_TRIG)
            Dim(RAMP5_FL)
            Dim(RAMP5_FLAG)
        else:
            UIC_ACT_START_FREQ5.Foreground = text_black;
            UnDim(ACT_START_FREQ5)
            UnDim(DES_END_FREQ5)
            UnDim(DURATION5)
            UnDim(RAMP5_DLY)
            UnDim(RAMP5_INC)
            UnDim(RAMP5_RST)
            UnDim(RAMP5_NEXT)
            UnDim(RAMP5_NEXT_TRIG)
            UnDim(RAMP5_FL)
            UnDim(RAMP5_FLAG)
            
        if(ACT_START_FREQ6.dValue<0):
            UIC_ACT_START_FREQ6.Foreground = text_grey;
            Dim(ACT_START_FREQ6)
            Dim(DES_END_FREQ6)
            Dim(DURATION6)
            Dim(RAMP6_DLY)
            Dim(RAMP6_INC)
            Dim(RAMP6_RST)
            Dim(RAMP6_NEXT)
            Dim(RAMP6_NEXT_TRIG)
            Dim(RAMP6_FL)
            Dim(RAMP6_FLAG)
        else:
            UIC_ACT_START_FREQ6.Foreground = text_black;
            UnDim(ACT_START_FREQ6)
            UnDim(DES_END_FREQ6)
            UnDim(DURATION6)
            UnDim(RAMP6_DLY)
            UnDim(RAMP6_INC)
            UnDim(RAMP6_RST)
            UnDim(RAMP6_NEXT)
            UnDim(RAMP6_NEXT_TRIG)
            UnDim(RAMP6_FL)
            UnDim(RAMP6_FLAG)
            
        if(ACT_START_FREQ7.dValue<0):
            UIC_ACT_START_FREQ7.Foreground = text_grey;
            Dim(ACT_START_FREQ7)
            Dim(DES_END_FREQ7)
            Dim(DURATION7)
            Dim(RAMP7_DLY)
            Dim(RAMP7_INC)
            Dim(RAMP7_RST)
            Dim(RAMP7_NEXT)
            Dim(RAMP7_NEXT_TRIG)
            Dim(RAMP7_FL)
            Dim(RAMP7_FLAG)
        else:
            UIC_ACT_START_FREQ7.Foreground = text_black;
            UnDim(ACT_START_FREQ7)
            UnDim(DES_END_FREQ7)
            UnDim(DURATION7)
            UnDim(RAMP7_DLY)
            UnDim(RAMP7_INC)
            UnDim(RAMP7_RST)
            UnDim(RAMP7_NEXT)
            UnDim(RAMP7_NEXT_TRIG)
            UnDim(RAMP7_FL)
            UnDim(RAMP7_FLAG)
            
    def RAMP_LIMIT_LOW_FREQ_Update():
        calc(RAMP_LIMIT_LOW_FREQ,RAMP_LIMIT_LOW_dec,RAMP_LIMITL_SGN,RAMP_LIMIT_LOW);
        pass;
    
    def RAMP_LIMIT_HIGH_FREQ_Update():
        calc(RAMP_LIMIT_HIGH_FREQ,RAMP_LIMIT_HIGH_dec,RAMP_LIMITH_SGN,RAMP_LIMIT_HIGH);
        pass;
        
    def RAMP_CMP0_FREQ_Update():
        calc(RAMP_CMP0_FREQ,RAMP_CMP0_dec,RAMP_COMP0_SGN,RAMP_CMP0);
        pass;
    
    def RAMP_CMP1_FREQ_Update():
        calc(RAMP_CMP1_FREQ,RAMP_CMP1_dec,RAMP_COMP1_SGN,RAMP_CMP1);
        pass;
    
    def calc(Freq,DEC,SGN,MAIN):
        if(PDF00.dValue!=0):
            ans = int((round(Freq.dValue/PDF00.dValue,4)-PLL_N.iValue)*16777216.0);
            if( ans < 0 ):
                SGN.iValue = 1;
                DEC.dValue = -1*float(ans);
            else:
                SGN.iValue = 0;
                DEC.dValue =(ans);
            if( ans > 4294967296.0 ):
                DEC.dValue = 4294967296.0;
                
            if(SGN.iValue == 0):
                MAIN.iValue = int(DEC.dValue);
            elif(SGN.iValue == 1):
                MAIN.iValue = int(8589934592-DEC.dValue);
    
        else:
            VCO_START_FREQ.dValue = -1;
        # WriteParameter(MAIN.codeloaderName,MAIN.iValue);
        # WriteParameter(LSB.codeloaderName,LSB.iValue);
        pass;
    
    def CALC_RAMP(ActStartFreq,DesEndFreq,ActEndFreq,Next,Reset,Len,IncDec,Inc):
        try:
            if(Reset.iValue!=0):
                g.LAST_ACT_ACC = float(g.START_ACT_ACC);
                ActStartFreq.dValue = float(VCO_START_FREQ.dValue);
                g.LAST_ACT_FREQ = float(VCO_START_FREQ.dValue);
            ActStartFreq.dValue=float(g.LAST_ACT_FREQ);
            g.ACC_ERR=float(((DesEndFreq.dValue/PDF00.dValue)*16777216)-g.LAST_ACT_ACC);
            if(Len.iValue!=0):
                IncDec.iValue=int(round(g.ACC_ERR/Len.iValue));
                if(IncDec.iValue<0):
                    Inc.iValue=1073741824+IncDec.iValue;
                else:
                    Inc.iValue=IncDec.iValue;
                g.LAST_ACT_ACC=Len.iValue*IncDec.iValue+g.LAST_ACT_ACC;
                g.LAST_ACT_FREQ=(g.LAST_ACT_ACC/16777216)*PDF00.dValue;
                ActEndFreq.dValue=float(g.LAST_ACT_FREQ);
                g.NEXT_RAMP=Next.iValue;
        except Exception, e:
            print e;
        pass;
    
    
    def System_Update_UI():
        if(float(UIC_ACT_START_FREQ1.Text)==-1):
            UIC_ACT_START_FREQ1.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ1.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_START_FREQ2.Text)==-1):
            UIC_ACT_START_FREQ2.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ2.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_START_FREQ3.Text)==-1):
            UIC_ACT_START_FREQ3.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ3.Foreground = SolidColorBrush(Colors.Black);      
        if(float(UIC_ACT_START_FREQ4.Text)==-1):
            UIC_ACT_START_FREQ4.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ4.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_START_FREQ5.Text)==-1):
            UIC_ACT_START_FREQ5.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ5.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_START_FREQ6.Text)==-1):
            UIC_ACT_START_FREQ6.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ6.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_START_FREQ7.Text)==-1):
            UIC_ACT_START_FREQ7.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_START_FREQ7.Foreground = SolidColorBrush(Colors.Black);
        pass   
        '''
        if(float(UIC_ACT_END_FREQ1.Text)==-1):
            UIC_ACT_END_FREQ1.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ1.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ2.Text)==-1):
            UIC_ACT_END_FREQ2.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ2.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ3.Text)==-1):
            UIC_ACT_END_FREQ3.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ3.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ4.Text)==-1):
            UIC_ACT_END_FREQ4.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ4.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ5.Text)==-1):
            UIC_ACT_END_FREQ5.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ5.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ6.Text)==-1):
            UIC_ACT_END_FREQ6.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ6.Foreground = SolidColorBrush(Colors.Black);
        if(float(UIC_ACT_END_FREQ7.Text)==-1):
            UIC_ACT_END_FREQ7.Foreground = SolidColorBrush(Colors.Red);
        else:
            UIC_ACT_END_FREQ7.Foreground = SolidColorBrush(Colors.Black);
        pass;
        '''
    def Modify_ControlProperties():
        try:
            # Accessing the User Control using script   
            # Note: All the User Controls of the flex page can be accessed using the following format:
            # UIC_ControlName where ControlName is the section name in the flex ini
            
            # Trying to add a new item "New" to the ComboBox named RAMP0_FLAG in the flex page
            list = UIC_RAMP0_FLAG.Items;
            list.Add("New");
            
            # Trying to modify the foreground and the text property of control named ACT_END_FREQ7 in the flex page if its values is -1
            if(float(UIC_ACT_START_FREQ7.Text)==-1):
                UIC_ACT_START_FREQ7.Foreground = SolidColorBrush(Colors.Red);
                UIC_ACT_START_FREQ7.Text = "< 0";
                
        except Exception, e:
            print "Exception",e;
        pass;
    
    def UpdateFromPLLTab():
        FPD_FREQ.dValue=PDF00.dValue
        VCO_START_FREQ.dValue=PDF00.dValue*(PLL_N.iValue+(PLL_NUM.iValue*1.0/16777216));
        ACC_START.dValue=16777216.0*PLL_N.iValue;
        RAMP_LIMIT_LOW_FREQ_Update();
        RAMP_LIMIT_HIGH_FREQ_Update();
        RAMP_CMP0_FREQ_Update();
        RAMP_CMP1_FREQ_Update();
        pass;
        
        
    Darren,

    As stated before, there is no python code for the PLL tab, so no we can not share this.

    The TICSPro source code is TI intellectual property, so no we can't share that.

    That being said, the code for the Ramping tab is in python and we can share that and it's attached.

    Regards,

    Dean

  • Thanks for your help Dean.  There is a lot of under the hood work going on outside of the ramp_calc python file.  For instance, actually setting any of the registers is hidden, as is the other 50-75% of the register controls. I was just hoping for more insight into that.  Oh well, I'll go write it for myself.  Thanks for the head start at least.  

    Darren

  • Darren,

    I'm actually the one who did the LMX2492 TICSPro file.

    From our perspective, we give the *.py files for each of the GUIs.

    For some newer PLLs  (i.e. LMX2594, ...), the PLL tab is actually a flex GUI and has python code.  But for older PLLs (i.e. LMX2495, LMX2531, ...), the PLL tab is actually hard coded and the LMX2492.ini file just gives the N, R, and other counters.   This code was originally in CodeLoader, but we had a contractor write TICSPro.  In any case, it is sort of sphagetti code, which is why we started the flex GUIs for TICSPro.

    If you really want a PLL tab, you might try to use one that does have one, such as the LMX2594 or LMX2615.  It's not the same part, but might be helpful.

    Regards,

    Dean

  • Dean,
    Good suggestion.
    And thanks for pointing out the .ini does hard loading for some of the registers, I hadn't thought about that.
    Thanks!
    Darren