We are using SHARC ADSP-SC589 with IMU unit ADIS16362.
Data transfer between the IMU and the SHARC is via SPI.
We want to configure it to work as follows:
After each sample cycle (IMU), DIO1 pulses high, which provides a new data ready control signal for driving system level interrupt service routines.
We want to configure a trigger to a pDMA (peripheral DMA) via the TRU every time data is ready (DIO1).
The pDMA should transmit the data (register to read), receive the data (via adi_spi_ReadWrite? adi_spi_SubmitBuffer?), trigger an interrupt to the core and wait for the next trigger from the IMU.
It would be even better if the DMA could have a buffer of ADI_SPI_TRANSCEIVERs to get a block of data before triggering an interrupt on the core - meaning the DMA will have a double buffer of let's say 10 transceivers on each and only after 10 samples accrued it will trigger an interrupt, while continuing transmitting and receiving data from IMU via the SPI.
I couldn't find an example showing how to configure SPI in a DMA mode. The 2 examples in
don't use DMA mode with the SPI.
BTW, How should the adi_spi_SubmitBuffer be used? It is non-blocking, how can I get triggered when it is done?
Thanks in advance,
You can find the example for SPI in DMA mode in the below link:https://ez.analog.com/message/204608
For using the 'adi_spi_SubmitBuffer' please refer the CCES help path:CrossCore Embedded Studio <version> > System Run-Time Documentation > System Services and Device Drivers > ADSP-SC58x (SHARC+ Core) API Reference > Modules > Modules > SPI Device Driver
Thank you Kader.
I have tried to run the SPI_MasterTx_Slave_Rx_Core1 example on the ADZS-SC589-EZLITE evaluation kit.
while(!(SPI0.Tx_Done & SPI0.Rx_Done & SPI1.Tx_Done & SPI1.Rx_Done));
does not come to an end...
The SPI0_TxDMA_Handler is triggered first and then SPI0_STAT_Handler, but SPI1_RxDMA_Handler is not triggered.
SPI0.Tx_Done, SPI0.Rx_Done, SPI1.Tx_Done are all equal to 1, but SPI1.Rx_Done is equal to 0.
I haven't made any changes to the source code.
Thanks in advance
Please find the attached project which is working correctly. Also can you please ensure that you have made correct external connections for Master and Slave.