Other Parts Discussed in Thread: HALCOGEN
Hi.
I implement ADC - DMA . The DMA BTC interrupt working fine and my adc conversations working fine. But my destination buffer which is in the L2RAM isn't filling. In debug mode when i suspend program and run again i see adc values in my destination buffer but when i suspend again the buffer is fully empty. What i do wrong?
/* DMA Configurations*/
g_dmaCTRL dmaCtrl;
dmaEnable();
dmaReqAssign(DMA_CH0, DMA_REQ10);
dmaCtrl.SADD = 0xFF3E0000U; //source address - FIFO of ADC1 group1
dmaCtrl.DADD = (uint32)adcDMAData; //destination address
dmaCtrl.CHCTRL = 0; //channel to be triggered after this one, in this case no other channel will be triggered
dmaCtrl.FRCNT = 2; //frame count
dmaCtrl.ELCNT = 32; //element count - 6 adc values to be read
dmaCtrl.ELDOFFSET = 0; //element destination offset
dmaCtrl.ELSOFFSET = 0; //element source offset
dmaCtrl.FRDOFFSET = 1; //frame destination offset
dmaCtrl.FRSOFFSET = 0; //frame source offset
dmaCtrl.PORTASGN = PORTB_READ_PORTA_WRITE; //PORTA
dmaCtrl.RDSIZE = ACCESS_32_BIT; //read size
dmaCtrl.WRSIZE = ACCESS_32_BIT; //write size
dmaCtrl.TTYPE = BLOCK_TRANSFER; //transfer type - FRAME_TRANSFER/BLOCK_TRANSFER
dmaCtrl.ADDMODERD = ADDR_INC1; //address mode read
dmaCtrl.ADDMODEWR = ADDR_INC1; //address mode write: ADDR_FIXED/ADDR_INC1/ADDR_OFFSET
dmaCtrl.AUTOINIT = AUTOINIT_ON; //autoinit
dmaSetCtrlPacket(DMA_CH0, dmaCtrl);
dmaSetChEnable(DMA_CH0, DMA_HW);
dmaEnableInterrupt(DMA_CH0,BTC , DMA_INTA);
/* ADC DMA Configuration*/
adcREG1->G1DMACR = (uint32) ((uint32) 64U << 16U) | //G1_BLOCKS 9bit
(uint32) ((uint32) 0U << 3U) | //DMA_G1_END 1bit
(uint32) ((uint32) 1U << 2U) | //BLK_XFER 1 bit
(uint32) 1U; //DMA_EN 1bit