Version 1.3
Page 24 of 36
SMT332/372 User Manual
// Wait for DMA to finish (could be linked to the DMA TCINT)
while((*DMA_PRI_CRTL0 & 0xc)!=0);
// Then setup the DMA to move the data from internal data memory
// into external SDRAM
*DMA_PRI_CRTL0 = 0x01000050;
*DMA_SRC_ADDR0 = (unsigned int)0x80008000;
// SDRAM is at address 0x02000000
*DMA_DST_ADDR0 = (unsigned int)(0x0j*0x00008000);
*DMA_XFR_CNTR0 = 0x00002000;
// Start DMA
*DMA_PRI_CRTL0 = 0x01000051;
// Wait for move complete. As DMA priority > CPU, this move
// should be very fast
while((*DMA_PRI_CRTL0 & 0xc) != 0);
j++;
// Repeat for 512 blocks
} while (j < 512);