You are here

timer and DMA | Cypress Semiconductor

timer and DMA

Summary: 3 Replies, Latest post by gdusher on 06 Dec 2013 10:13 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
gdusher's picture
2 posts

Hi all,

I'm working on a PSOC5LP (Freesoc) and I have a problem with the output of the DMA.

The DMA copy the capture output from a Timer (UDB) on the SRAM and it always output 0. The DMA work fine (I see it on a oscilloscope) and the timer work fine too because when I read the capture output with the ReadCapture() function it output a good result. I'm missing something ?


Thank for your help !


user_1377889's picture
9301 posts

The upper source and destination addresses are wrong for a PSoC5 chip.

Look into the datasheet for DMA and read the chapter named "DMA address portability".



user_78878863's picture
2553 posts

When your ISR reads the capture register, it is empty. And if your ISR is faster than the DMA (and given the DMA setup time, this is rather likely), the DMA will only read 0...

(I did not look at the whole project though, just at main.c...)

gdusher's picture
2 posts

Thanks for you reply, I change the value of the destunation address ( Upper and Lower) and I delete the ISR.

I have some good value in my destination address.

My change:


        HI16(CYDEV_PERIPH_BASE), HI16(temp));
    DMA_1_TD[0] = CyDmaTdAllocate();
    CyDmaTdSetConfiguration(DMA_1_TD[0], 20, DMA_1_TD[0], DMA_1__TD_TERMOUT_EN | TD_INC_DST_ADR);
    CyDmaTdSetAddress(DMA_1_TD[0], LO16((uint32)Timer_1_CAPTURE_LSB_PTR), LO16((uint32)temp));
    CyDmaChSetInitialTd(DMA_1_Chan, DMA_1_TD[0]);
    CyDmaChEnable(DMA_1_Chan, 1);

Log in to post new comments.