PSOC 5 SAR ADC DMA to 8 bit EMIF

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I would like to dma from the SAR ADC to an 8 bit EMIF, 1MSPS.  I have configured one TD,

I put a scope on the SAR EOC, and the WEN on the EMIF output.

I only get 1 write per EOC, even if I set to increment destination address.

  Is this possible.

#define PACKET       (2u)

#define DMA_BYTES_PER_BURST (2u) /* should be 2 for 16-bit DMA transfer */

#define DMA_REQUEST_PER_BURST (1u)

#define BURST_LENGTH (PACKET) /* DMA burst length would need to be a multiple of 2 bytes for 16-bit DMA transfer */

    /**************************************************************

    * Set up DMA to transfer data

    ***************************************************************/

    /* Write Data to external memory */

    DMA_ADC_Chan = DMA_ADC_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST,  HI16(CYDEV_PERIPH_BASE), HI16(CYDEV_EXTMEM_BASE));

    DMA_ADC_TD[0] = CyDmaTdAllocate();

    CyDmaTdSetConfiguration(DMA_ADC_TD[0], BURST_LENGTH, DMA_ADC_TD[0], DMA_ADC__TD_TERMOUT_EN | TD_INC_DST_ADR );

    CyDmaTdSetAddress(DMA_ADC_TD[0], LO16((uint32)ADC_SAR_WRK0_PTR), LO16((uint32)CYDEV_EXTMEM_BASE));

    CyDmaChSetInitialTd(DMA_ADC_Chan, DMA_ADC_TD[0]);

    CyDmaChEnable(DMA_ADC_Chan, 1);

0 Likes
1 Solution
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I hate to reply to my own question, but here goes:  You can't.  You will only every get one byte transferred to the EXTMEM 8 bit bus when coming from the ADC using DMA.

However, it appears that you can use DRQ and NRQ even for DMA from SRAM to EXTMEM.

I DMA'd into a 2 byte buffer in SRAM.  I chained the ADC DMA NRQ into DMA unit #2 DRQ which did an 8 bit transfer into EXTMEM from buffer[0].  It's NRQ chained into DMA Unit #3, which did an 8 bit transfer into EXTMEM from buffer[1].  Took most of a microsecond.

Using fictitious data in memory to make it easy to see on a scope, I got the results I wanted.

On to the next step.....

View solution in original post

0 Likes
1 Reply
WaMa_286156
Level 5
Level 5
First comment on blog 100 replies posted 50 replies posted

I hate to reply to my own question, but here goes:  You can't.  You will only every get one byte transferred to the EXTMEM 8 bit bus when coming from the ADC using DMA.

However, it appears that you can use DRQ and NRQ even for DMA from SRAM to EXTMEM.

I DMA'd into a 2 byte buffer in SRAM.  I chained the ADC DMA NRQ into DMA unit #2 DRQ which did an 8 bit transfer into EXTMEM from buffer[0].  It's NRQ chained into DMA Unit #3, which did an 8 bit transfer into EXTMEM from buffer[1].  Took most of a microsecond.

Using fictitious data in memory to make it easy to see on a scope, I got the results I wanted.

On to the next step.....

0 Likes