You are here

Read timer FIFO use DMA | Cypress Semiconductor

Read timer FIFO use DMA

Summary: 1 Reply, Latest post by U2 on 24 Oct 2011 12:30 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
jason1984's picture
1 post

Hello i am new with the psoc and have a problem.

I am using a timer to capture the time between two rising edges. After the second edge occur the timer generate a interrupt signal on the interrupt Output. This signal i am using to start the DMA Transfer. With the DMA i want to get the captured Values at the Timer FIFO. My problem is that i get only one Value. My design and code are below.

#include <device.h>

uint8 fifo_resynchtimer_dma_Chan;
uint8 fifo_resynchtimer_dma_TD[1];
bit resynch_flag=0;
uint16 synch_timer_captured[2];
uint16 period_synch=0;
#define fifo_resynchtimer_dma_BYTES_PER_BURST 4
#define fifo_resynchtimer_dma_REQUEST_PER_BURST 1
#define fifo_resynchtimer_dma_SRC_BASE (CYDEV_SRAM_BASE)
#define fifo_resynchtimer_dma_DST_BASE (CYDEV_SRAM_BASE)
void main()

 fifo_resynchtimer_dma_Chan = fifo_resynchtimer_dma_DmaInitialize(fifo_resynchtimer_dma_BYTES_PER_BURST, fifo_resynchtimer_dma_REQUEST_PER_BURST,
  HI16(fifo_resynchtimer_dma_SRC_BASE), HI16(fifo_resynchtimer_dma_DST_BASE));
 fifo_resynchtimer_dma_TD[0] = CyDmaTdAllocate();
 CyDmaTdSetConfiguration(fifo_resynchtimer_dma_TD[0], 2, fifo_resynchtimer_dma_TD[0], TD_SWAP_EN | fifo_resynchtimer_dma__TD_TERMOUT_EN | TD_INC_SRC_ADR | TD_INC_DST_ADR);
 CyDmaTdSetAddress(fifo_resynchtimer_dma_TD[0], LO16((uint32)resynch_timer_CAPTURE_LSB_PTR), LO16((uint32)&synch_timer_captured[0]));
 CyDmaChSetInitialTd(fifo_resynchtimer_dma_Chan, fifo_resynchtimer_dma_TD[0]);
 CyDmaChEnable(fifo_resynchtimer_dma_Chan, 1);

 if (resynch_flag)
  resynch_flag=0; //resynch flag is set in the isr_period_capture


uday's picture
Cypress Employee
569 posts

Could you attach your project here, so that we can see what the actual issue is.

Log in to post new comments.