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.

SPI INTERFACE IN LM98722

Other Parts Discussed in Thread: LM98722

Hi 

We are using LM98722 in our project we are trying to write the internal register page 0 register 0 for setting up the external crystal we send the data in the following sequence upon power up after 2 seconds delay 

////Addressing the first page 

P4OUT&=~SEN;
SPI_WRITE(0x1F);
SPI_WRITE(0x00);
P4OUT|=SEN;

//writing the values to the register for enabling the external crystal 
P4OUT&=~SEN;
SPI_WRITE(0x00);
SPI_WRITE(0x28);
P4OUT|=SEN;

finally we are writing the following sequence for reading the device 

P4OUT&=~SEN;
SPI_WRITE(0x10);
SPI_WRITE(0x00);
P4OUT|=SEN;
P4OUT&=~SEN;
SPI_WRITE(0x00);
P4OUT|=SEN;

i am not getting any values in the rxbuffer

do let me know if the sequence in correct 

with regards

Gokuleswaran

  • Hello,

    If you are enabling the external crystal oscillator mode, you should wait for some time for the oscillator to start up, and the internal PLLs to lock to that clock source before resuming SPI communications.

    Please try this and let me know.

    Regards,

    Hooman

  • Dear Mr Hooman Hashemi

    After Power on we are using this code for enabling the external crystal we are using 5 Mhz crystal as the input clock 

    P4OUT&=~SEN;  ////Chip Select
    __delay_cycles(100);/// 6 us delay
    SPI_WRITE(0x1F);  ////// Addressing the first page 
    SPI_WRITE(0x00);
    __delay_cycles(100); /////6 us delay
    P4OUT|=SEN;     //////Chip deselect
    __delay_cycles(100);/// 6 us delay
    P4OUT&=~SEN;   ////Chip Select
    __delay_cycles(100);/// 6 us delay
    SPI_WRITE(0x00); /// writing the first register to enable the external crystal
    SPI_WRITE(0x28);
    __delay_cycles(100); /////6 us delay
    P4OUT|=SEN;   //////Chip deselect
    __delay_cycles(1000000); 6.2 Milliseconds delay 

    After this code there is no spi communication between the AFE and the Micro controller when we probe on the crystal there is no oscillation 

    pls let us know that we are sending the correct sequence , is there any power up sequence that we need to go through before issuing the commands

    with regards

    Gokul

  • Hi Gokul,

    Please make sure you are waiting at least 50ms or longer, if not already?

    From page 86:

    "After either starting or stopping INCLK, or after Software Reset (Register Page 0, Address 1, [4:3]), users should wait for 50 ms to allow the internal PLL and logic to stabilize before resuming Serial Interface communications."

    If it never works after a long delay (1s or more) then it may be an issue with the oscillator circuit you may have.

    Please post your schematics and layout information showing the crystal oscillator circuitry and LM98722. These circuits are very sensitive to loading on the two connections, especially the XTAL in (INCLK+ pin).

    Regards,

    Hooman

  • Dear Hooman

    we have waited for more than 1 sec but the crystal is not loading here with i am attaching the circuit pls let us know if there is any issues in the circuit

  • The inclk from uC line has been isolated there is no connection between the LM98722 and the uC
  • Hi Gokul,
    Can you please also supply your board layout image around the area of the XTAL?

    Regards,
    Hooman
  • Hi Hooman

    C17 and C18 are Loading Capacitors , 18pF , and Y1 is 5 Mhz

  • Hi Gokul,
    The layout / schematic look fine.
    Any chance you can try a higher frequency XTAL or some sort of external differential clock source to debug the board otherwise?

    How are you looking for the XTAL oscillation - Are you putting a scope probe on it? Could the scope probe capacitance be responsible for attenuating or stopping the XTAL from oscillation? Can the XTAL oscillation be "sniffed" with a high frequency probe close by without touching the leads?

    Regards,
    Hooman
  • Dear Hooman 

    We have not tried the higher frequency XTAL oscillation we will try it and let you know in a short while

    Gokul