This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DMA

Other Parts Discussed in Thread: TMS570LS3137

For formation of short signals on an output of port of general purpose I used the DMA module in a mode of block transmission. Serial transmission of data array to port was made for testing of working capacity { 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 }. The following pattern was as a result watched approximately:



to what appearance of time delays between transmission of 4 words can be connected?


DMA module initialization:

DMA_GR1_ARRAY[16] = { 0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1 };

void DMA_Packet_Init(void)
{
    TDMA dmast;
    dmast.chan = 13;         
    dmast.reqline = 13;
    dmast.lnf = 1;
    dmast.lnb = 16;
    dmast.src = (unsigned long)DMA_GR1_ARRAY;
    dmast.dst = (unsigned long)&gioPORTA->DOUT;
    dmast.chain = 0;
    dmast.addmr =  ADDR_INC1;
    dmast.addmw  = ADDR_FIXED;
    dmast.ttype = BLOCK_TRANSFER;
    dmast.eioff_dst = 0;
    dmast.eioff_src = 0;
    dmast.fioff_dst = 0;
    dmast.fioff_src = 0;
    dmast.prio = 1;
    DMA_Init(&dmast);
}



void DMA_Init(TDMA * dma)
{
    register uint32_t i=0,j=0;
    dmaReqAssign(dma->chan,dma->reqline);
    dmaRAMREG->PCP[dma->chan].ISADDR  =  dma->src;    // src    
    dmaRAMREG->PCP[dma->chan].IDADDR  =  dma->dst;     // dst
    dmaRAMREG->PCP[dma->chan].ITCOUNT =  ((dma->lnf) << 16) | dma->lnb;    
    dmaRAMREG->PCP[dma->chan].CHCTRL  = (ACCESS_32_BIT  << 14)|
                                        (ACCESS_32_BIT  << 12)|
                                        ((dma->ttype) << 8 )|
                                        ((dma->addmr) << 3 )| // src
                                        ((dma->addmw) << 1 )| // dst
                                        (AUTOINIT_OFF);
    dmaRAMREG->PCP[dma->chan].CHCTRL |= ((dma->chain) << 16);
    dmaRAMREG->PCP[dma->chan].EIOFF   = ((dma->eioff_dst) << 16) | (dma->eioff_src);
    dmaRAMREG->PCP[dma->chan].FIOFF   = ((dma->fioff_dst) << 16) | (dma->fioff_src);
    i = (dma->chan) >> 3;                /* Find the register to write                  */
    j = (dma->chan) -(i << 3);           /* Find the offset of the 4th bit              */
    j = 7 -j;                            /* Reverse the order of the 4th bit offset     */
    j = j<<2;                            /* Find the bit location of the 4th bit to write*/
    dmaREG->PAR[i] &= ~(0xf<<j);
    dmaREG->PAR[i] |= (4<<j);
    dmaREG->CHPRIOS |= (dma->prio) << (dma->chan);      //  prioritet
}



  • Sergrey,

    I believe that the the memory space for the GIO registers is configured as "strongly ordered". DMA does transfer in 4x32 bit bursts. On TMS570LS3137, there is a 12 VCLK internal delay in writing to peripherals for each burst (single write can be considered as burst size 1) in strongly ordered memory type. this delay is reduced to 2 VCLK if the memory type is changed to "device". There is always a 12 VCLK internal delay in reading from peripherals. The following thread provides some more information.

    http://e2e.ti.com/support/microcontrollers/hercules/f/312/t/211679.aspx

    Thanks and regards,

    Zhaohong