PDA

View Full Version : TC1779 DMA with ASC



Georg.X
Feb 16th, 2016, 07:16 AM
Hi,

Ohhhhh sorry i have a TC1798.

I try to configurate a DMA channel to read data from ASC0 and write it to a buffer.
I get always errors a Move Engine 0 Source Error, and an FPI bus error.

This errors i also see if i want only copy from one buffer to a other one.

Can someone help me to understand and to fix it?

This is my intialisation:

RTS_UI8 auc_Buffer[100];

void DMA_UART_Init(void) //TODO (RTS_UI8 *puiDestination)
{
for (int i=0; i<100; i++)
{
auc_Buffer[i] = i+1;
}

_endinit_clear();
DMA_CLC.U = 0x08; /* enable/disable DMA request IRQ */
_endinit_set();

/* restart DMA controller */
DMA_HTREQ.B.DCH00 = 1; /* disable HW request */
DMA_CHRSTR.B.CH00 = 1; /* reset transfer request */
while(DMA_CHRSTR.B.CH00 == 1); /* wait until reset is done */

DMA_SADR00.B.SADR = 0xf0000a24; /* source address */
DMA_DADR00.B.DADR = (RTS_UI32)&(auc_Buffer[0]); /* destination address */

DMA_CHCR00.B.PRSEL = 0x05; /* mux ASC0_RDR RX-IRQ to DMA */
DMA_CHCR00.B.CHDW = 0x00; /* 8Bit transfare between source and destination */
DMA_CHCR00.B.CHPRIO = 1; /* set prio to highest */
DMA_CHCR00.B.DMAPRIO = 3; /* set prio to highest */
DMA_CHCR00.B.RROAT = 1; /* reset request after finish completely transfer */
DMA_CHCR00.B.CHMODE = 1; /* continuous mode */
DMA_ME0AENR0.B.AEN5 = 1; /* enable access to ASC0 addressrange */

DMA_ADRCR00.B.CBLD = 0x8; /* Circular Buffer Length Destination */
DMA_ADRCR00.B.CBLS = 0; /* Circular Buffer Length Source */
DMA_ADRCR00.B.DMF = 0; /* Destination Address Modification Factor */
DMA_ADRCR00.B.INCD = 1; /* Increment of Destination Address */
DMA_ADRCR00.B.INCS = 0; /* Increment of Source Address */
DMA_ADRCR00.B.SHCT = 0x2; /* Shadow Control */
DMA_ADRCR00.B.SHWEN = 0; /* Shadow Address Register Write Enable */
DMA_ADRCR00.B.SMF = 0; /* Source Address Modification Factor */

DMA_HTREQ.B.ECH00 = 1; /* enable HW request => start one transfer*/
}

thx.
Georg.