m m

Problem with dma and uart for MCF52235EVB

Discussion created by m m on Dec 18, 2006
Latest reply on Jan 15, 2008 by GLENN WILSON
Hello!
 
I want to use dma with uart for my project. I have used some example code obtain in the forum but I have bus error and I can't sent or read over the uart. This is my init function for the DMA Controller. But with this init Code,Hope, you can help me! Or you have Application Notes?
 
void mcf52235_dma0_init(void)
{
 
MCF_DMA_DMAREQC |= MCF_DMA_DMAREQC_DMAC2(0xC); // UART Transmit
MCF_DMA_DMAREQC |= MCF_DMA_DMAREQC_DMAC0(0x8); // UART Receive
MCF_SCM_GPACR0 |= 0x06; // Read, Write
MCF_SCM_GPACR1 |= 0x06; // Read, Write
MCF_SCM_PACR2 |= 0x60; // Read, Write // UART
MCF_DMA_SAR0 = MCF_UART0_URB; // Receiver UART Buffer
MCF_DMA_DAR0 = (volatile unsigned long)&recvBuf[0];
MCF_DMA_SAR2 = (volatile unsigned long)&sendBuf[0]; // Transmit UART Buffer
MCF_DMA_DAR2 =  MCF_UART0_UTB;
MCF_DMA_DCR2 |= MCF_DMA_DCR_DSIZE(0x1) | // Destination Size
MCF_DMA_DCR_SSIZE(0x1) | // Soure Size
MCF_DMA_DCR_SINC | // Source Increment
MCF_DMA_DCR_CS | // Single read/write
MCF_DMA_DCR_INT; // Internal interrupt signal is enabled
MCF_DMA_DCR_AA; // Autoalign enable

MCF_DMA_DCR0 |= MCF_DMA_DCR_DSIZE(0x1) | // Destination Size
MCF_DMA_DCR_SSIZE(0x1) | // Soure Size
MCF_DMA_DCR_DINC | // Destination Increment
MCF_DMA_DCR_CS | // Single read/write
MCF_DMA_DCR_EEXT | // Enable external request to initiate transfer
MCF_DMA_DCR_AA; // Autoalign enable

MCF_SCM_RAMBAR |= (MCF_SCM_RAMBAR_BDE ); // Backdoor enable and SPV Secondary Port Valid
MCF_DMA_BCR2 = 8; // Byte Count Register
MCF_DMA_BCR0 = 8; // Byte Count Register
 
 
}

Outcomes