AnsweredAssumed Answered

Has anyone used SPI to interface an Arduino and their DSP like on ADSP-BF706 EZ-KIT Mini

Question asked by thorbjorn88 on Apr 28, 2016
Latest reply on Apr 13, 2017 by Sudheer

I'm trying to get my BF706 to work as an SPI slave to an Arduino and cannot find any examples of how to get the BF706 to work as an SPI slave. Below is one configuration I've tried. What am I missing? Am I using the correct function to read the transceiver?

 

//set up SPI

  //*****************************************************************

    /* SPI driver handle */

    ADI_SPI_HANDLE hDevice;

 

 

    /* driver API result code */

  ADI_SPI_RESULT SPIresult;

 

 

  /* transceiver buffers */

  uint8_t RxBuffer[7] = {0};

  uint8_t TxBuffer[7] = {0x0,0x1,0x2,0x3,0x4,0x5,0x6};

 

 

  /* transceiver configurations */

  ADI_SPI_TRANSCEIVER Transceiver1  = {NULL, 0, &TxBuffer[0], 7, &RxBuffer[0], 7};

    /* open the SPI driver */

  SPIresult = adi_spi_Open(0, SPIDriverMemory, (uint32_t)ADI_SPI_DMA_MEMORY_SIZE, &hDevice);

  CheckSpi(SPIresult);

    //Configure SPI

    SPIresult = adi_spi_SetMaster(hDevice, false); //slave msb first

    CheckSpi(SPIresult);

    //SPIresult = adi_spi_SetHwSlaveSelect(hDevice, false); //HW slave select

   // CheckSpi(SPIresult);

    //SPIresult = adi_spi_SetSlaveSelect(hDevice, ADI_SPI_SSEL_ENABLE1);

    //CheckSpi(SPIresult);

 

 

    //match transmitted

    SPIresult = adi_spi_SetClockPolarity(hDevice, false);

    CheckSpi(SPIresult);

    SPIresult = adi_spi_SetClockPhase(hDevice, true);

    CheckSpi(SPIresult);

    SPIresult = adi_spi_SetWordSize(hDevice, ADI_SPI_TRANSFER_8BIT);

    CheckSpi(SPIresult);

 

 

    SPIresult = adi_spi_RegisterCallback(hDevice, NULL, NULL);

    CheckSpi(SPIresult);

    /* Diable DMA */

    SPIresult = adi_spi_EnableDmaMode(hDevice, false);

    CheckSpi(SPIresult);

    /* submit the SPI transceiver's buffers */

    SPIresult = adi_spi_ReadWrite(hDevice, &Transceiver1);

Outcomes