cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

Anonymous
Not applicable

Hello There!

   

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 */
    uint8 channelHandle;

   

    /* Declare DMA Transaction Descriptor for memory transfer into
     * Filter Channel. */
    uint8 tdChanA;

   

    /* 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,
                                        HI16(UPPER_SRC_ADDRESS), HI16(UPPER_DEST_ADDRESS));

   

    /* 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 */
    CyDmaChSetInitialTd(channelHandle, tdChanA);

   

    /* Enable the DMA channel represented by channelHandle and preserve the TD */
    CyDmaChEnable(channelHandle, 1u);

   

 

   

Can anyone help me get it to work, or just give me a hint at where i am doing wrong.

   

Project is atrtached.

0 Likes
Reply
1 Reply
cadi_1014291
Valued Contributor

I was going to suggest you to watch this video https://www.youtube.com/watch?v=oq8eQhvkceM but i just see that the ADC on that project is configured to 8bits 😕 .

   

Are you sure you want to increase the source and destination addresses?

   

/* 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));

   

If ADC_DEC_SAMP_16B_PTR is the source then you should be always pointing to that address, not increment it, same for RIAA_STAGEA_PTR,

   

also i don't see the need for casting them to uint32_t.

   

I didn't checked the project yet but that's what i see from the code you shared here.

   

Carlos

0 Likes
Reply