MCF5282_DMA0_DCR |= 0x00100000; // Source Size 1 (destination hold by default)
MCF5282_DMA0_DCR |= 0x20000000; // Enable Cycle Steal Mod
MCF5282_DMA0_DCR |= 0x00080000; // Enable Destination Increment
MCF5282_DMA0_DCR |= 0x00020000; // Destination Size 1
ptr = &ModNetUart->RxBuffer[ModNetUart->RxWritePtr];
MCF5282_DMA0_DAR = (DWORD)ptr; // Setup Destination Address
MCF5282_DMA0_BCR |= 0x00FFFFFF; // Setup Byte Count to 255 (ignores lower 2 bytes)
MCF5282_DMA0_SAR |= (DWORD)&MCF5282_UART1_URB; // Source to UART1 Receive Buffer
MCF5282_SCM_DMAREQC = 0x0009; // Setup DMA0 for UART1
MCF5282_DMA0_DCR |= 0x40000000; // External Enable
Now, what ends up happening is I enable the External DMA0 Enable, and I get an Error 0x21 in the MCF5282_DMA0_DSR register (Source Error).
Some points of confusion:
1). There is no clear way to setup DMA for only transmits or only recieves in the 5282 user manual.
2). There is a footnote in the UART register description saying DMA only works on channels 2 and 3 - but this is not clear and never repeated in the documentation.
3). The masking of Rx interrupts is described in a confusing manner in the documentation. What should the status of the IMR and UMR registers be for UART1 for DMA to work on only recieves?
Could anyone possibly provide me with some sample code for making DMA work on recieves for a 5282 core? I've seen a previous thread with samples for a 5223 transmit driven by an external peripheral, but was unable to adapt it for what I need. Thank you very much in advance for any help you can provide me with!