You are here

ADC_SAR -> DMA -> FIR_Filter | Cypress

ADC_SAR -> DMA -> FIR_Filter

Summary: 2 Replies, Latest post by Dick22 on 24 Mar 2011 03:31 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
timhappy's picture
User
1 post

Hello everyone,

I'm working with the PSoC5 Dev-Kit CY8CKIT-001 and PSoC Creator 1. I try to transfer the result of the ADC_SAR to the filter-block via DMA. My DMA config is: 

 /* DMA Configuration for DMA_ADC2Filter */
    #define DMA_ADC2Filter_BYTES_PER_BURST 2
    #define DMA_ADC2Filter_REQUEST_PER_BURST 1
    #define DMA_ADC2Filter_SRC_BASE (CYDEV_PERIPH_BASE)
    #define DMA_ADC2Filter_DST_BASE (CYDEV_PERIPH_BASE)
    DMA_ADC2Filter_Chan = DMA_ADC2Filter_DmaInitialize(DMA_ADC2Filter_BYTES_PER_BURST, DMA_ADC2Filter_REQUEST_PER_BURST,
        HI16(DMA_ADC2Filter_SRC_BASE), HI16(DMA_ADC2Filter_DST_BASE));
    DMA_ADC2Filter_TD[0] = CyDmaTdAllocate();
    DMA_ADC2Filter_TD[1] = CyDmaTdAllocate();
     if(DMA_ADC2Filter_Chan == DMA_INVALID_TD || DMA_ADC2Filter_TD[0] == DMA_INVALID_TD)
    {
           LCD_Position(0,0) ;
        LCD_PrintString("DMA Error") ;
    }
    
    if (CyDmaTdSetConfiguration(DMA_ADC2Filter_TD[0], 2, DMA_ADC2Filter_TD[1], TD_INC_SRC_ADR | TD_INC_DST_ADR | TD_SWAP_EN | TD_SWAP_EN ) != CYRET_SUCCESS) // c);
    {    
        LCD_Position(0,0) ;
        LCD_PrintString("DMA Error") ;
    }
    
    if (CyDmaTdSetConfiguration(DMA_ADC2Filter_TD[1], 2, DMA_ADC2Filter_TD[0], TD_SWAP_EN ) != CYRET_SUCCESS)
    {    
        LCD_Position(0,0) ;
        LCD_PrintString("DMA Error") ;
    }
    CyDmaTdSetAddress(DMA_ADC2Filter_TD[0], LO16((uint32)ADC1_SAR_WRK0_PTR), LO16((uint32)FIR_Filter_STAGEA_PTR));
    CyDmaTdSetAddress(DMA_ADC2Filter_TD[1], LO16((uint32)ADC1_SAR_WRK1_PTR), LO16((uint32)FIR_Filter_STAGEA_PTR));
    CyDmaChSetInitialTd(DMA_ADC2Filter_Chan, DMA_ADC2Filter_TD[0]);
    if (CyDmaChEnable(DMA_ADC2Filter_Chan, 1) != CYRET_SUCCESS)
    {    
        LCD_Position(0,0) ;
        LCD_PrintString("DMA Error") ;
    }

I took the config from the example and it works fine for the lower byte. But not for the higher one. The problem is that the result of the conversion is stored in two different registers of just 1 byte, not as in the example in one 16 bit-register. I gues the ardesspointers need to be configured in a certain way, but I don't know how.

Can anyone tell me how? 

Thanks in advance! 

timhappy

 

user_156863's picture
User
7 posts

 Hi Tim,

Not sure if this is your issue, but I noticed when using the UDB that there was a seperate register for the 16-bit access to the FIFO then for the 8-bit access. If you look in Cyfitter.h you can see the register aliases.

If you get this working let me know - I have to do the same thing.

Kelly

Dick22's picture
User
3 posts

Hi Tim and Kelly,

 

I´m working on the same problem but i did not find a solution by now.

If you have some thing let me know.

Dick22

Log in to post new comments.