AnsweredAssumed Answered

BF 526 SPI device operation

Question asked by lokesh327 on Jan 19, 2012

Hello,

 

I am new to work on bf 526 and want to create an application which can use spi device to send and receive data.

 

I have designed code but i am not even getting the clock signal waves on oscilloscope. so kindly check the below code and help me in provide some idea or sample application which can work using spi.

 

 

adi_ssl_Init();

 

Result1 = adi_dev_Init(DevMgrData, sizeof(DevMgrData), &i, &adi_dev_ManagerHandle, ADI_SSL_ENTER_CRITICAL);

 

Result = adi_dev_Open( adi_dev_ManagerHandle,            /* DevMgr handle */                   

                    &ADISPIIntEntryPoint,                /* pdd entry point */
                    0,                                    /* device instance */
                    NULL,                                /* client handle callback identifier */
                    &SPIdevicehandle,                    /* DevMgr handle for this device */
                    ADI_DEV_DIRECTION_BIDIRECTIONAL,    /* data direction for this device */
                    NULL,                                /* handle to DmaMgr for this device */
                    NULL,                                /* handle to deferred callback service */
                    spi_Callback);   

 

 

 

 

 

   
    *pPORTG_MUX |= 0x0000;
    ssync();

 

    *pPORTG_FER |= ( PG6 | PG7 | PG8 | PG9 | PG10 | PG15);
    ssync();

 

    *pPORTH_FER |= PH9;
    ssync();
   
   
        *pSPI_FLG |= FLS1;                           
        *pSPI_BAUD = 4;                   
        *pSPI_CTL |= CPOL | MSTR | SPE;            ssync();

 

        *pSPI_TDBR = Data[0];
   
        while ((*pSPI_STAT & TXS))
                break;
               
    while (!(*pSPI_STAT & SPIF))
        break;   
       
    while (!(*pSPI_STAT & RXS))
        break;

 

please suggest the solution or correction needed     

Outcomes