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.

LMX2572EVM: Not Outputting Every Frequency

Part Number: LMX2572EVM

I've written code such that I sweep from 101MHz to 2GHz. I'm able to see all of my frequencies produced if I leave about 6 printf statements before I write to my registers, but only see a few frequencies produced if the printf statements are commented out. The fewer print statements I leave in the code, the more frequencies get dropped. Does anyone know why this may be occurring? 

  • Hi Gerardo,

    What is your exact power up and programming sequence? For example,

    (1) Vcc power up the device

    (2) Pull CE pin high

    (3) wait for some time

    (4) Program all the registers to make it lock to 101MHz

    (5) Program certain registers to make it lock to 102MHz, and so on.

  • 1) 

    LMX_SPI_WRITE(0x00, 0x211E); //FCAL_HPFD_ADJ = 2, FCAL_LPFD_ADJ = 0, FCAL_EN = 1, MUXOUT_LD_SEL = 1, RESET = 1
    LMX_SPI_WRITE(0x06, 0x2802); //LDO_DLY = 5,LDO start up delay such that StateMachineFrequency is 80 MHz ≤ f < 130 MHz
    LMX_SPI_WRITE(0x00, 0x211C); //FCAL_HPFD_ADJ = 2, FCAL_LPFD_ADJ = 0, FCAL_EN = 1, MUXOUT_LD_SEL = 1, RESET = 0

    2)

    Calculate the values for PLL_NUM & PLL_N in a for loop for the frequencies I specify. I keep PLL_DEN as 100 throughout the whole program.

    I also check to see what range of frequencies I'm in so that I could change the CHDIV accordingly.

    if(PLL_N > 48){
                            LMX_SPI_WRITE(0x25, 0x0305);  //R37    PFD_DLY_SEL
                            }
    else{LMX_SPI_WRITE(0x25, 0x0205);}  //R37   PFD_DLY_SEL

    3)

    I then place the printf statements because this allows for all frequencies to be shown on the spectrum analyzer.

    4) Write to registers

            LMX_SPI_WRITE(0x2B, PLL_NUM);       // Writing to PLL_NUM register
            LMX_SPI_WRITE(0x2A, 0);             // Writing to PLL_NUM register
            LMX_SPI_WRITE(0x27, 100);           // Writing to PLL_DEN register
            LMX_SPI_WRITE(0x26, 0x0000);        // Writing to PLL_DEN register
            LMX_SPI_WRITE(0x24, PLL_N); //Writing to PLL_N register
            LMX_SPI_WRITE(0x22, 0x0010);//Writing to PLL_N register
            LMX_SPI_WRITE(0x00, 0x211C); //Turning on muxout

    The following is how I write to LMX

    uint8_t LMX_SPI_WRITE(uint8_t address, uint16_t data)
        {  
        SPI_LMX_CS = 0;
        //send 28bit data
        address = address & 0x7F; //    R/W bit must be set to 0 in order to write to register
        SWSPI_write(address, 8);
        SWSPI_write(data, 16);
        SPI_LMX_CS = 1; 
        return 0;           
        }

  • Noel, 

    I appreciate you getting back to me.

    I figured that showing you the code would be the best way to show you what I'm doing. Perhaps this is too much... Let me know.

    Thanks!

    I found this last set of code to not produce all of the frequencies(100MHz to 2GHz). The following code does though.

    void sweep()
    {
        float PLL_NUM = 0;
        float PLL_N = 0;
        float startingValue = 0;
        int PLL_NUM_int = 0;
        int PLL_N_int = 0;
        float PLL_NUM_whole = 0;
        float incrementValue = 0;
        int frequency = 101;
        //LMX_SPI_WRITE(0x00, 0x0002);                //Resetting R0    
       for(frequency = 101; frequency <= 2000; frequency = frequency + 1)
                    {
                        if(frequency == 101)      //Changing the startingValue & incrementalValue based on frequency desired
                        {
                            //startingValue = 32.32;
                            startingValue = 32.32;
                            incrementValue = 0.32;
                        }
                        if(frequency == 201)
                        {
                            startingValue = 32.16;
                            incrementValue = 0.16;
                        }
                        if(frequency == 401)
                        {
                            startingValue = 32.08;
                            incrementValue = 0.08;
                        }
                        if(frequency == 801)
                        {
                            startingValue = 32.04;
                            incrementValue = 0.04;
                        }
                        if(frequency == 1601)
                        {
                            startingValue = 32.02;
                            incrementValue = 0.02;
                        }
                    PLL_NUM = startingValue - (int) startingValue;//Separating the float into a whole number and a decimal part
                    PLL_N = startingValue - PLL_NUM;
                    PLL_NUM_whole = PLL_NUM * 100;
                    PLL_NUM_int = (int) PLL_NUM_whole;
                    PLL_NUM_int = PLL_NUM_int + 1;
                    PLL_N_int = (int) PLL_N;
                    printf("frequency = %i\n, PLL_N = %i\n, PLL_NUM = %i\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
                    printf("frequency = %i\n, PLL_N = %04x\n, PLL_NUM = %04x\n",frequency, PLL_N_int, PLL_NUM_int);
    
                    startingValue = startingValue + incrementValue;
                    //frequency = frequency + 1;
     
                    LMX_SPI_WRITE(0x00, 0x0002);                //Resetting R0
                    if((frequency >= 101) && (frequency <= 200))
                    {
                        LMX_SPI_WRITE(0x4B, 0x09C0);            //Writing 32 to CHDIV 
                    }
                    if((frequency >= 201) && (frequency <= 400))
                    {
                        LMX_SPI_WRITE(0x4B, 0x0940);            //Writing 16 to CHDIV 
                    }
                    if((frequency >= 401) && (frequency <= 800))
                    {
                        LMX_SPI_WRITE(0x4B, 0x08C0);            //Writing 8 to CHDIV 
                    }
                    if((frequency >= 801) && (frequency <= 1600))
                    {
                        LMX_SPI_WRITE(0x4B, 0x0840);             //Writing 4 to CHDIV 
                    }
                    if((frequency >= 1601) && (frequency <= 3200))
                    {
                        LMX_SPI_WRITE(0x4B, 0x0800);              //Writing 2 to CHDIV 
                    } 
                    LMX_SPI_WRITE(0x2B, PLL_NUM_int);   // Writing to PLL_NUM register
                    LMX_SPI_WRITE(0x2A, 0);            // Writing to PLL_NUM register
                    LMX_SPI_WRITE(0x27, 100);         // Writing to PLL_DEN register
                    LMX_SPI_WRITE(0x26, 0x0000);     // Writing to PLL_DEN register
                    LMX_SPI_WRITE(0x24, PLL_N_int); //Writing to PLL_N register
                    LMX_SPI_WRITE(0x00, 0x211C);   //Turning on muxout
                    
                    }
    }

  • Hi Gerardo,

    I am afraid I do not understand the codes. Would you describe the power up and programming sequence? For example,

    (1) Vcc power up the device

    (2) Pull CE pin high

    (3) wait for some time

    (4) Program all the registers (what is the sequence?) to make it lock to 101MHz

    (5) Program certain registers (What is the sequence?) to make it lock to 102MHz, and so on.