I think I have some misconception about the DMA request of the eTimer module.
Q1: I don’t know how to use the INTDMA register.
Example: if I want to use the DMA read requests for CAPT1,then I should set the .ICF1DE bit (INTDMA) .
My question is whether I need to configure the conrresponding DMA channel source , channel source address and destination addrress?
My confusion is that the ICF1DE bit which equals 1 has showed the souce address is CAPT1, does we need configure the source address again?
Did anone have conrresponding example codes ?
Thanks very much!
Yanna
解決済! 解決策の投稿を見る。
1. On eTimer CMPLD2 you want to trigger DMA transfer.
2. DMA is triggered on this event if DMA and DMAMUX is properly configured.
3. Source/Destination address of DMA can aby any valid address.
4. If you want to set CMPLD2 value by DMA then set the destination address to CMPLD2 address and source address to address containing desired value of CMPLD2.
5. You can also achieve this by SW via interrupt.
Reference manual is not correctly describing eDMAMUX.
It should be as follows.
Peter
Hi,
Yes you need configure DMA and also DMAMUX.
In DMA you need to properly configure also corresponding TCD.
If you want to transfer data from peripherals you need to configure also AIPS bridge.
Peter
Hi,Peter,could you help check the following code ?
…
ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD2DE = 1; //enable DMA write requests to the CMPLD2(channel 0 ,Etimer0)
ETIMER_0.DREQ0.B. DREQ0 =00011; // select channel 0 CMPLD2 DMA write requests
ETIMER_0.DREQ0.B. DREQ0_EN =1; // DMA request enable
ETIMER_0.ENBL.B.ENBL =000001; // enable channel 0
DMAMUX.CHCONFIG[0].B.TRIG = 0;
DMAMUX.CHCONFIG[0].B.SOURCE = 14; // DMA write requests
DMAMUX.CHCONFIG[0].B.ENBL = 1;
EDMA.CHANNEL[0].TCDWORD0_.B.SADDR = &VAL_CMPLD2; // Source Address
EDMA.CHANNEL[0].TCDWORD16_.B.DADDR =&CMPLD2; // Destination address
(then configure smod,ssize and so on. )
I just want to emphasize destination address and principle,
My question : is destionation address in above codes right ?
Another question, could destionation address be the value which has no relation with CPMLD2 ?
Thanks very much!
Yanna
Your destination address is pointing on CMPLD2.
I cannot see definition of CMPLD2 in your code. How do you want me to judge?
First of all:
etimer can trigger the DMA transfer on Comparator Load Register 2 Flag set.
When DMAMUX is properly configured the corresponding DMA channel is triggered.
DMA transfer source and destination addresses can be set to any valid address. (memory/registers).
eTimer or any other DMA trigger source provide only HW version of polling START bit in dma TCD.
As the DMA module is quite complicated I suggest you to read DMA chapter in reference manual carefully.
Hi,peter, the destionation address is ETIMER_0.CMPLD2.R
EDMA.CHANNEL[0].TCDWORD16_.B.DADDR =&ETIMER_0.CMPLD2.R;
When data is transferred out of the CMPLD2 register and ETIMER_0.CHANNEL[0].INTDMA.B.CMPLD2DE = 1 ,did the destionation address of the conrresponding DMA channel must be &ETIMER_0.CMPLD2.R ?
From your words,it seemed that it can be any valid address. P.476 It says when a CMPLD2 write request occours,it means CMPLD2 neeeds an update,so the destination address of the conrresponding DMA channel seems should be the &ETIMER_0.CMPLD2.R,is it right? If the destination address isn’t the ETIMER_0.CMPLD2.R,how could the CMPLD2 register get the update value?
Q2: why did the DMA_mux module have no etimer channel 2~4 DMA request source.
If etimer0 DMA request select register select channel 5 CMPLD1 DMA write request, how to configure the corresponding DMA_MUX source ?
Thanks very much!
Yanna
Hi,Peter. Thanks very much! It helps me a lot.
another question,If I set Destination address of DMA the address which has no relation with CMPLD2(CMPLD2DE = 1) , will the ETIMER_0.CMPLD2.R value maintain the original value?
Thanks very much!
Yes, it will maintain the original value until it is changed via DMA or via software (core).
1. On eTimer CMPLD2 you want to trigger DMA transfer.
2. DMA is triggered on this event if DMA and DMAMUX is properly configured.
3. Source/Destination address of DMA can aby any valid address.
4. If you want to set CMPLD2 value by DMA then set the destination address to CMPLD2 address and source address to address containing desired value of CMPLD2.
5. You can also achieve this by SW via interrupt.
Reference manual is not correctly describing eDMAMUX.
It should be as follows.
Peter