AnsweredAssumed Answered

SPORT TX DMA IRQ - BF561

Question asked by Laz on Apr 19, 2011
Latest reply on Apr 25, 2011 by Laz

I am trying to get an interrupt at the end of a SPORT TX sequence.  I have configured the SPORT and DMA below.  I can see on the scope that the data string is being sent, and the DMA Complete bit is set, but I don't get the IRQ (the ISR is never called).

 

I've looked at the Audio Codec Talk-through example, and my code looks similar.  I'm probably missing something simple.

 

TIA;

Dan

 

// init the ISR

Void initSportISR()

{

            register_handler_ex(ik_ivg9, slaveTxRxIsr, EX_INT_ENABLE);               // assign ISR to interrupt vector

 

            *pSICA_IAR2 = Peripheral_IVG(23,9);                   // assign interrupt channel 23 DMA SPORT0 RX to IVG9

            *pSICA_IAR3 = Peripheral_IVG(24,9);                   // assign interrupt channel 24 DMA SPORT0 TX to IVG9

          

            *pSICA_IMASK0 |= SIC_MASK(9);           // un-mask the IRQ

            ssync();

            *pILAT |= EVT_IVG9;                                  // clear pending IVG9 interrupts

            ssync();

}

 

 

void transmitSlave( BYTE  *buf, int  bufSize)

{

// config the DMA

            *pSPORT0_RCR1 = 0; // turn off RECV

          

            *pDMA2_1_IRQ_STATUS = 0x0f; // clear all flags

 

            *pDMA2_1_PERIPHERAL_MAP               = 0x1000; // set to SPORT0_TX

            // set up DMA transfer

            *pDMA2_1_START_ADDR = buf; // data buffer

            *pDMA2_1_X_COUNT        = bufSize;        // this is the number of bytes to send

            *pDMA2_1_X_MODIFY = 1;          // 8-bit data

            // Enable DMA, read from mem, 8-bit, En IRQ, clear FIFO,

            *pDMA2_1_CONFIG = DMAEN | WDSIZE_8 | RESTART | DI_EN; // no Flow = Stop

 

// config the SPORT

                      

            // configure to transmit on the Primary channel

            *pSPORT0_TCR2 = 7; // 8 data - 1

            // Enable, Internal Clock and Frame, Late Frame required, Frame goes LO

            *pSPORT0_TCR1 = TSPEN | ITCLK | ITFS | TFSR | LTFS | LATFS | TCKFE; // add drive on Falling edge (read on rising)

}

Outcomes