Hi. I really need help to set up DMA for K60 from Freescale. I have set up a timer to trigger when a rising edge appear on the input pin. I want to store that 'timestamp' in an array by DMA. I want to use DMA because to minimize the overhead by using interrupts.

If there is an expert in how to initiate DMA please let me know. I've tried several guides but nothing works when i try. I have posted my code and I'm using uTasker as OS.

Code:
uint16 Data_Desti[16];//destination data space
// Configure the DMA MUX and DMA controller module.
void dma_init(void)
{
	// Config DMA MUX 
	POWER_UP(6, SIM_SCGC6_DMAMUX0);
	// Config DMA controller
	POWER_UP(7, SIM_SCGC7_DMA);
	
  DMAMUX0_CHCFG0 = (DMAMUX_CHCFG_ENBL | DMAMUX_CHCFG_SOURCE_FTM0_CH0);
	
	DMA_TCD0_SADDR = (uint32)&FTM0_C0V; 
	
	DMA_TCD0_DADDR = (uint32)(&Data_Desti[0]);		// Destination address
	DMA_TCD0_DOFF = 2;														// Destination address incremented by two bytes (16 bit)
	DMA_TCD0_DLASTSGA = (uint32)-32;											// Restores the destination address to the initial value (2*16bit)
	
	DMA_TCD0_NBYTES_MLNO = 2;											// Transfer 8 bytes per transaction

	DMA_TCD0_BITER_ELINKNO = 16;								// Channel Linking Disabled
	DMA_TCD0_CITER_ELINKNO = 16;								// Channel Linking Disabled
	
	DMA_TCD0_ATTR = (DMA_TCD_ATTR_DSIZE_16 | DMA_TCD_ATTR_SSIZE_16); 	// Source and Destination modulu
	DMA_TCD0_CSR = (DMA_TCD_CSR_MAJORELINK | DMA_TCD_CSR_INTMAJOR);						//The end-of-major loop interrupt is enabled
	
	DMA_ERQ |= DMA_ERQ_ERQ0;
	
	fnEnterInterrupt(irq_DMA0_ID, PRIORITY_DMA0, dma0_isr); 
}

static __interrupt void dma0_isr(void)
{			
	DMA_CINT = DMA_INT_INT0;
	//DMAMUX0_CHCFG0= 0;
	//DMA_INT =	0x01;
	//DMA_CDNE = 0x01;
	for(i=0;i<8;i++)
	{
		fnDebugDec(i, sizeof(i));
		fnDebugMsg(") cnt=");
		fnDebugDec(Data_Desti[i], sizeof(Data_Desti));
		fnDebugMsg("\r\n");
	}
}