ad7928 connect  ADSP21369 with spi

hello friends

i design a system using ad7928 collect the data.

now the spiclk , mosi and cs has signals,but the miso cann't catch the signal.it always high.

below is my functions.


    SRU(SPI_MOSI_O,DPI_PB01_I)      //Connect MOSI to DPI PB1.
    SRU(DPI_PB02_O, SPI_MISO_I)     //Connect DPI PB2 to MISO.
    SRU(SPI_CLK_O, DPI_PB03_I)      //Connect SPI CLK to DPI PB3.
    SRU(SPI_FLG0_O, DPI_PB04_I)     //Connect SPI FLAG3 to DPI PB4.
    //---------------------------------------------------------------------------
    // Tie pin buffer enable from SPI peipherals to determine whether they are
    // inputs or outputs

    SRU(SPI_MOSI_PBEN_O, DPI_PBEN01_I);
    SRU(SPI_MISO_PBEN_O, DPI_PBEN02_I);
    SRU(SPI_CLK_PBEN_O, DPI_PBEN03_I);
    SRU(SPI_FLG0_PBEN_O, DPI_PBEN04_I);

void SPITransmit(int val)
{
     *pTXSPI = val;
     Delay(10);

    //Wait for the SPI to indicate that it has finished.
    while (1)
    {
        if (*pSPISTAT & SPIF)
            break ;
    }
    Delay (10) ;
}

void adcommand()

{

       8e5e9a042abdb7130e1538d46d9df541.htmlSPITransmit(0xff);
     SPITransmit(0xff);
      
       SPITransmit(0xff);
     SPITransmit(0xff);   

    SPITransmit(0x3f);
     SPITransmit(0x08);

}

//ad7928
void SPIisr (void)
{
     int ad_temp=0,temp=0,temp1,ad_temp1=0;

    temp++;

    SPITransmit(0x3f);
    SPITransmit(0x00);   
   
    //ad_temp = ;
//    ad_temp1= *pTXSPI;
    ad_temp = *pRXSPI;

}

now i can go into the interrupt,but the value of  *pRXSPI always  zero, but the pin is high!!!!!

thanks

tracy

Parents
  • 0
    •  Analog Employees 
    on Aug 2, 2018 4:21 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin
Reply
  • 0
    •  Analog Employees 
    on Aug 2, 2018 4:21 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin
Children
No Data