AnsweredAssumed Answered

DMA with 65536 Major Loops

Question asked by AnEngineer on Jun 25, 2015
Latest reply on Jul 6, 2015 by Earl Orlando Ramirez Sanchez

Hello together,

 

I have a small example code working, using a major loop of 5, reading 4 Bytes every time by the minor loop.

 

For our application, I need a Major Loop with 65536 counts, reading 16 Bytes every time.

The problem: if I have no active linking, I have only 15 bits to define the CITER value.

 

I think I have to realize it by linking channels. But which registers I have to set up, in addtion to my small working example?

 

Thanks for any help!

 

Kind regards!

 

The Code:

#ifdef __arm__
  
   // Set PORTF Pin for DMA Request
   // DMA Request for rising edge; Port as GPIO;
   PORTF->PCR[22] &= ~PORT_PCR_IRQC_MASK &~PORT_PCR_MUX_MASK;
   PORTF->PCR[22] = PORT_PCR_IRQC(1) | PORT_PCR_MUX(1);
   
   // Enable clock for DMAMUX and DMA
    SIM->SCGC6 |= SIM_SCGC6_DMAMUX1_MASK;
    SIM->SCGC7 |= SIM_SCGC7_DMA_MASK;
            
    // Enable Channel 0 and set PORTF (FPGA_INT#2) as DMA request source 
    DMAMUX1->CHCFG[0] |= DMAMUX_CHCFG_ENBL_MASK | DMAMUX_CHCFG_SOURCE(53);
   
    // Enable request signal for channel 0 
    DMA0->ERQ = DMA_ERQ_ERQ16_MASK;
        
    // Set memory address for source and destination 
    DMA0->TCD[16].SADDR = FPGA_DMA_rdDMA;
   DMA0->TCD[16].DADDR = DDR_ADRESS_START;

    // Set an offset for source and destination address
    DMA0->TCD[16].SOFF = 0x00; // Source address offset per transaction
    DMA0->TCD[16].DOFF = 0x04; // Destination address offset per transaction
        
    // Set source and destination data transfer size 32bit
    DMA0->TCD[16].ATTR = DMA_ATTR_SSIZE(2) | DMA_ATTR_DSIZE(2);
        
    // Number of bytes to be transfered in each service request of the channel
    DMA0->TCD[16].NBYTES_MLNO = 0x04; // 4 Bytes pro Minor Loop
        
    // Current major iteration count (a single iteration of 5 bytes)
    DMA0->TCD[16].CITER_ELINKNO = DMA_CITER_ELINKNO_CITER(5);
    DMA0->TCD[16].BITER_ELINKNO = DMA_BITER_ELINKNO_BITER(5);
    
    // Adjustment value used to restore the source and destiny address to the initial value
    DMA0->TCD[16].SLAST = 0x00;           // Source address adjustment
    DMA0->TCD[16].DLAST_SGA = -0x14;    // Destination address adjustment
    
    // Setup control and status register
    DMA0->TCD[16].CSR = 0;
      
#else
#endif

Outcomes