Counter with DMA

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

I'm trying to do a DMA transfer of the capture value but I can not read anything.

image1.JPG

Configure of DMA :

#define DMA_BYTES_PER_BURST      4

#define DMA_REQUEST_PER_BURST    1

#define DMA_SRC_BASE              (CYDEV_PERIPH_BASE)

#define DMA_DST_BASE             (CYDEV_SRAM_BASE)

    Channel_Counter3 = DMA_Counter3_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST, HI16(DMA_SRC_BASE), HI16(DMA_DST_BASE));

    counter3_TD_0 = CyDmaTdAllocate();

    CyDmaTdSetConfiguration(counter3_TD_0, 4, counter3_TD_0, DMA_Counter3__TD_TERMOUT_EN | CY_DMA_TD_INC_SRC_ADR );

    CyDmaTdSetAddress(counter3_TD_0, LO16((uint32) Counter_3_STATICCOUNT_LSB_PTR), LO16((uint32)counter[2]));

    CyDmaChSetInitialTd(Channel_Counter3,counter3_TD_0);

    CyDmaChEnable(Channel_Counter3, (1u));

Captura.JPG

DMA hardware Request :Rising edge

Is something wrong?

I want to transfer the capture data and then active the interrupt and reset the counter.

Regards and thank you!

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I don't see where the value of the counter is being transferred? Secondly, if you want to use interrupt, then why do you need a DMA? Some additional info about destination would help to answer your question.

View solution in original post

0 Likes
2 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

I don't see where the value of the counter is being transferred? Secondly, if you want to use interrupt, then why do you need a DMA? Some additional info about destination would help to answer your question.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

The enable input is fed with a very short pulse from the debouncer. Only while "enable" is high the counter will work.

Bob