Problem with dma and uart for MCF52235EVB

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Problem with dma and uart for MCF52235EVB

1,347件の閲覧回数
ma81
Contributor I
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
 
 
}
ラベル(1)
0 件の賞賛
返信
1 返信

572件の閲覧回数
Glenn
Contributor I
We are about to connect two MCF52236 processors via UART DMA so I can't help you yet. Might you have a schematic how you connected your UART in DMA mode? Thanks, Glenn  glenn.wilson@emerson.com
0 件の賞賛
返信