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.

CC2430 DMA Interrupt Problem

Other Parts Discussed in Thread: CC2430

Hello,

 

I want the DMA to transfer one 16-bit word each time it is triggered. After the DMA has transferred six 16-bit words, I want it to generate an interrupt to the CPU. How can I do that? Currently, I set the transfer count as 6 and use the repeated single mode, but I am not sure if I should set the Interrupt Mask as 1. It seems that if I set the Interrupt Mask, the DMA will generate an interrupt to the CPU after each single DMA transfer, but if I don’t set it, the DMA will not generate an interrupt at all.

  • Yulin Zhang said:
    Currently, I set the transfer count as 6 and use the repeated single mode, but I am not sure if I should set the Interrupt Mask as 1. It seems that if I set the Interrupt Mask, the DMA will generate an interrupt to the CPU after each single DMA transfer, but if I don’t set it, the DMA will not generate an interrupt at all.

    Are you actually seeing this behavior?  Section 13.5.2.7 of the CC2430 datasheet indicates in a Repeated Single mode, on a trigger a single DMA transfer occurs and the DMA channel awaits the next trigger.  After the number of transfers specified by the transfer count are completed, the CPU is notified and the DMA channel is rearmed.

  • No, I did not see this behavior. I asked because the datasheet says "Upon completing a DMA transfer, the channel can generate an interrupt to the processor. This bit will mask the interrupt." So I don't know if the DMA generates an interrupt after each single transfer or if the DMA only generates an interrupt after a set of transfers specified by the transfer count.

  • Based on the reading of the cited section in the CC2430 datasheet and Figure 18 on page 89, I would say that the interrupt would occur after the entire transfer completes.

  • BrandonAzbell said:

    Based on the reading of the cited section in the CC2430 datasheet and Figure 18 on page 89, I would say that the interrupt would occur after the entire transfer completes.

    Thanks! This is what I want to know.

  • Hi,

    I have to use DMA to transfert Data from Radio Rx without using interrupt.The problem is that the DMA transfert only the first byte when the DMA channel 0 flag =1

     char __xdata destAddr[110];

     // Receiver On
       basicRfReceiveOn();
      //Clearing the destination  
      memset(destAddr,0,sizeof(destAddr)); 
     
      IOCFG0 = 0xFF;
      EA = 1;
      DMAIF = 0;
      DMAIE = 1;   

      // Setting up the DMA channel.  
      SET_WORD(dmaChannel.SRCADDRH, dmaChannel.SRCADDRL,   &X_RFD);
      SET_WORD(dmaChannel.DESTADDRH, dmaChannel.DESTADDRL, &destAddr); 
      SET_WORD(dmaChannel.LENH, dmaChannel.LENL, 111); 
      dmaChannel.VLEN      = 1;
      dmaChannel.PRIORITY  = 2;   
      dmaChannel.M8        = 0;
      dmaChannel.IRQMASK   = 0;       
      dmaChannel.DESTINC   = 1;    
      dmaChannel.SRCINC    = 0;   
      dmaChannel.TRIG      = 19; 
      dmaChannel.TMODE     = 0;
      dmaChannel.WORDSIZE  = 0;
      DMA_ABORT_CHANNEL(0);    
       
      RFST = 0xE2;
       // Save pointer to the DMA config. struct into DMA ch. 0 config. registers
      SET_WORD(DMA0CFGH, DMA0CFGL, &dmaChannel);    
     
      DMAARM = 0x01;
     
      if ( DMAARM != 0x00 )   DMAARM = 0x80;      // Abort DMA channel
      DMAARM |= 0x01; 
      
      while (!(RFIF & 0x20));
     
        // Start dma channel transfert  or Trigger channel
      DMAIRQ = 0x00;
      DMAREQ = 0x01;
     
      // Waiting for the DMA to finish.  
      while(!(DMAIRQ & 0x01));

     

    the result is that only one byte will be transferred.

    Tks.

    moon

  • Hi moon.

    It seems like you are using the wrong TMODE (transfer mode) value in your DMA configuration. You have set it as 00 (=single transfer, which only transfers 1 byte/word per DMA radio trigger), but I think you might want to try to use 01 (=block transfer) to transfer a whole packet upon one single DMA trigger event.

  • Hi esy,

    Thank you for your response. The problem wasn't in the DMA mode but in the structure configuration.

    moon

     

  • Sorry to undig this old post!

    But I'm having the exact same problem. The DMA only sends the firt byte and nothing else (and the Interruption does not trigger).

    What was wrong with you structure configuration?