I am trying to make a data transfer between my a delta sigma ADC and a Filter. I can do this perfectly by doing it with the CPU, however i want to do it with DMA.
I have tried using the wizard and looked at different examples. I can get it to work using 8-bit values, but want it done for 16-bit components.
Right now the code in the project is (I've tried a lot, and changed a lot. Right now the code is from an example):
/* Defines for DMA */
#define REQUEST_PER_BURST (1u)
#define BYTES_PER_BURST (3u)
#define UPPER_SRC_ADDRESS CYDEV_PERIPH_BASE
#define UPPER_DEST_ADDRESS CYDEV_PERIPH_BASE
/* Declare variable to hold the handle for DMA channel */
/* Declare DMA Transaction Descriptor for memory transfer into
* Filter Channel. */
/* Configure the DMA to Transfer the data in 1 burst with individual trigger
* for each burst.*/
channelHandle = DMA_DmaInitialize(BYTES_PER_BURST, REQUEST_PER_BURST,
/* This function allocates a TD for use with an initialized DMA channel */
tdChanA = CyDmaTdAllocate();
/* Source and Destination address increments are needed as we are using 3 byte transfers
but Spoke Width is 16 bit */
CyDmaTdSetConfiguration(tdChanA, 3u, tdChanA, TD_INC_SRC_ADR | TD_INC_DST_ADR);
/* Set the source address as ADC_DelSig and the destination as
* Filter Channel A.*/
CyDmaTdSetAddress(tdChanA, LO16((uint32)ADC_DEC_SAMP_16B_PTR), LO16((uint32)RIAA_STAGEA_PTR));
/* Set tdChanA to be the initial TD associated with channelHandle */
/* Enable the DMA channel represented by channelHandle and preserve the TD */
Can anyone help me get it to work, or just give me a hint at where i am doing wrong.
Project is atrtached.
P4sender.zip 3.3 MB