Other Parts Discussed in Thread: CONTROLSUITE
Hello,
I have a customer using DMA to reduce memory transfer overhead on the CPU. Right now, 128 bytes (32x32 bits) of data are being transferred from GS memory to EMIF1.
Using the CPU, this takes approx 8us to complete. In 16 bit DMA mode, the same transfer takes 32.8 us, and in 32 bit DMA mode, the transfer lasts 27.4 us. Since using 32 bit mode cuts down the transfers by half, this suggests that the actual DMA transaction takes ~5 us.
Timing is done using the IPC counter, starting from right before the DMA is triggered, and ending once the DMA complete interrupt is triggered.
The following are the values used to configure DMA ch1:
DmaRegs.CH1.BURST_SIZE.all = 31U; // 32 16 bit words(X-1) x-ferred in a burst. DmaRegs.CH1.SRC_BURST_STEP = 1U; // Increment source addr between each word x-ferred. DmaRegs.CH1.DST_BURST_STEP = 1U; // Increment dest addr between each word x-ferred. // Set up TRANSFER registers: DmaRegs.CH1.TRANSFER_SIZE = 7U; // 4 bursts (X-1) per transfer, DMA interrupt will occur after completed transfer. DmaRegs.CH1.SRC_TRANSFER_STEP = 1U; // TRANSFER_STEP is ignored when WRAP occurs. DmaRegs.CH1.DST_TRANSFER_STEP = 1U; // TRANSFER_STEP is ignored when WRAP occurs. DmaClaSrcSelRegs.DMACHSRCSEL1.bit.CH1 = 0U; // Source select DmaRegs.CH1.MODE.bit.PERINTSEL = 1U; // Should be hard coded to channel, above now selects source DmaRegs.CH1.MODE.bit.PERINTE = 1U; // Peripheral interrupt enable DmaRegs.CH1.MODE.bit.ONESHOT = 1U; // Oneshot enable DmaRegs.CH1.MODE.bit.CONTINUOUS = 1U; // Continuous enable DmaRegs.CH1.MODE.bit.OVRINTE = 0U; // Enable/disable the overflow interrupt DmaRegs.CH1.MODE.bit.DATASIZE = 1U; // 16-bit/32-bit data size transfers DmaRegs.CH1.MODE.bit.CHINTMODE = 1U; // Generate interrupt to CPU at beginning/end of transfer DmaRegs.CH1.MODE.bit.CHINTE = 1U; // Channel Interrupt to CPU enable // Clear any spurious flags: Interrupt flags and sync error flags DmaRegs.CH1.CONTROL.bit.PERINTCLR = 1U; DmaRegs.CH1.CONTROL.bit.ERRCLR = 1U;
Any input on reducing this transfer time would be appreciated, thanks!
Munan