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. nonAuto-Initiation.



Hello. I set up SPI4 through DMA:

       chan = DMA_CH1;
   dmaReqAssign(chan,25);
   dmaRAMREG->PCP[chan].ISADDR  =  (uint32_t)(TX_DATA);    
   dmaRAMREG->PCP[chan].IDADDR  =  (uint32_t)(&(spiREG4->DAT1));
   dmaRAMREG->PCP[chan].ITCOUNT =  (ln << 16) | 1;    
       dmaRAMREG->PCP[chan].CHCTRL  =     (ACCESS_32_BIT  << 14)| \
                                   (ACCESS_32_BIT  << 12)| \
                                   (FRAME_TRANSFER << 8 )| \
                                   (ADDR_INC1      << 3 )| \
                                   (ADDR_FIXED        << 1 )| \
                                   (AUTOINIT_OFF);
    dmaRAMREG->PCP[chan].CHCTRL |= (0 << 16);
    dmaRAMREG->PCP[chan].EIOFF   = (0 << 16) | (0);
    dmaRAMREG->PCP[chan].FIOFF   = (0 << 16) | (0);
    i = chan >> 3;                /* Find the register to write                    */
    j = 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->HWCHENAS = (1 << chan);    


when Auto-Initiation = ON, occurs automatic restarting of data transfer. It is necessary for me a mode when Auto-Initiation = OFF.
Thus transmission occurs only once after initialization. Repeted change of registers of setup of the channel doesn't restart transmission process:

   dmaRAMREG->PCP[chan].ISADDR  =  (uint32_t)(TX_DATA1);    
   dmaRAMREG->PCP[chan].ITCOUNT =  (ln2 << 16) | 1;    


Prompt how to solve this problem?