AnsweredAssumed Answered

BF506 UART  EDTPTI mode

Question asked by SeaWolf on Aug 26, 2011
Latest reply on Oct 17, 2011 by vinodbableshwar

Hello. I can't configure the UART0 DMA transfer using EDTPTI bit(ADSP-BF50x Processor Hardware reference rev1.0 p.15-25 ). When DMA work unit finished transmit data interrupt not generated. In normal mode,I do the following and it work correctly:

EX_INTERRUPT_HANDLER(UART_DMA_HANDLER)
{
    ushort regVal;  
    regVal = *pDMA9_IRQ_STATUS;
    if(regVal)
    {
        if(regVal & DMA_DONE)
        {
            *pUART0_IER_CLEAR = ETBEI;
            *pDMA9_IRQ_STATUS |= DMA_DONE;

             while(!(*pUART0_LSR & TEMT))
                asm volatile("nop;");
        }
    }

     .......

}

void InitUART0_bf506()

{

     ......

     *pSIC_IMASK0  |= (1 << 23) | (1<<22);     //dma9,dma8 enable interrupt

     .....

     register_handler(ik_ivg10,UART_DMA_HANDLER);

     ....

     *pDMA9_CONFIG = FLOW_STOP | WDSIZE_8 | SYNC | DI_EN;  

}

 

void WriteUART_DMA(void* buf,ushort size)

    *pDMA9_START_ADDR = buf;
    *pDMA9_X_COUNT = size;
    *pDMA9_X_MODIFY = 1; 
    *pDMA9_CONFIG |= DMAEN;     
    ssync();
    *pUART0_IER_SET = ETBEI;
}

But when I use EDTPTI my InitUART0_bf506() and WriteUART_DMA have changes

void InitUART0_bf506()

{

     ....

     *pDMA9_CONFIG = FLOW_STOP | WDSIZE_8 | SYNC;    // ! No DI_EN, because TEMT event triggers a DMA interrupt after the DMA’s last wor has left the UART transmit buffers

     ....

}

 

// EDTPTI not defined in cdefBF50x_base.h

#ifndef EDTPTI

#define EDTPTI 0x10   

#endif

void WriteUART_DMA(void* buf,ushort size)

     *pDMA9_START_ADDR = buf;
     *pDMA9_X_COUNT = size;
     *pDMA9_X_MODIFY = 1; 
     *pDMA9_CONFIG |= DMAEN;     
     ssync();
     *pUART0_IER_SET = ETBEI | EDTPTI;   
}

After DMA work unit complete Interrupt not generated.

Outcomes