I am currently working on using the DMA together with an interrupt to exchange data with SPORT1 on a BF609. For some reason, the IRQ does not seem to occur with every XCNT=0 but rather randomly.... Is there some example code out there how to do this? It should not be that complicated.
This is my configuration:
*pREG_DMA3_CFG = ENUM_DMA_CFG_PSIZE04 | ENUM_DMA_CFG_MSIZE04 | ENUM_DMA_CFG_AUTO | BITM_DMA_CFG_TWOD | ENUM_DMA_CFG_XCNT_INT; // 32-bit transfers, autobuffer mode
*pREG_DMA3_ADDRSTART = iAudioTxBuffer; // start address of data buffer
*pREG_DMA3_XCNT = (AUDIO_TX_BUFFERSIZE >> 1);
*pREG_DMA3_XMOD = 4;
*pREG_DMA3_YCNT = 2;
*pREG_DMA3_YMOD = 4;
adi_int_InstallHandler(INTR_SPORT1_B_DMA, Sport1_TX_ISR, NULL, true); //API defined in adi_int.h
*pREG_DMA3_CFG |= BITM_DMA_CFG_EN; // enable DMA for TX
*pREG_SPORT1_CTL_B |= BITM_SPORT_CTL_SPENPRI; // enable SPORT TX
As I understand the documantation, Sport1_TX_ISR Should occur when pREG_DMA3_ADDR_CUR is pointing to the first and second half of the buffer, but it does not... Am I missing something?