SPIB slave DMA setting
1.I want to set the processor 21489 SPI slave.
2.I use ESP32 SPI master to keep on transmiting the 24 bytes (4-ADXL345 ACC data) to 21489.
3.How can i set the ADSP21489 SPIB to poll receiving the data by DMA interrupt.
Could you provide the example code Visual DSP++ for me ?
The previous example code no longer updates the value after receiving DMA data once
void set_interrupt()
{
// clear registers, set RX/TX flush bits
*pSPICTLB = (RXFLSH);
*pSPIDMACB = FIFOFLSH;
*pSPICTLB = 0;
*pCPSPIB = 0;
*pSPIFLGB = 0;
*pSPISTATB = 0xff;
*pSPIDMACB = 0;
//*pSPIBAUDB = 0x2;
//*pSPIFLGB = DS0EN;
*pIISPIB = dest;
*pIMSPIB = 1;
*pCSPIB = N;
// clear_RX_buffer();
*pSPICTLB = WL8 | TIMOD2 | MSBF | CPHASE | CLKPL | SMLS | DMISO | GM;
*pSPICTLB |= SPIEN;
*pSPIDMACB = SPIRCV | INTEN;
*pSPIDMACB |= SPIDEN;
}
void SPI_Rx_Isr(int sig)
{
//read data form dest
...
//
}
--------
while (1)
{
set_interrupt();
interrupts(SIG_P18, SPI_Rx_Isr);
while (!DMA_Rx_done)
{
asm("nop;");
}
....
//Calculate data
....
}
Hi,
Please refer the “Chained DMA Transfers”(Page No: 754/1304) programming model in the ADSP-21489 HRM manual.
Please find the attached SPI slave receive example code for ADSP-212xx. Please use this as a reference.SPI DMA Chaining.zip
Regards,
Divya.P
Thank you I will try it .
Thank you I will try it .