ADC Filter VDAC

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

I modified the ADC Filter VDAC example to have an additional DMA for transferring data from filter to VDAC. The project is attached. I compiled it and downloaded to PSoC3 030 board. The DMA for ADC to Filter input is operating, but DMA for Filter to VDAC.

0 Likes
6 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I must be blind but I do not see setup code for DMA_Filter ?

   

 

   

Also its trigger is set for "Level", should that be edge or derived ?

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Are you trying to modify the ADC to Filter project by adding DMA instead of ISR

   

to service VDAC from filter output ? If so you need to config and setup the

   

DMA_Filter block.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Setup for DMA_Filter is in DMA_Config() as below.

   

void DMA_Config(void)
{
    /* Declare variable to hold the handle for DMA channel */
    uint8 channelHandle;
    uint8 channelFilter;
   
    /* Declare DMA Transaction Descriptor for memory transfer into
     * Filter Channel.
     */
    uint8 tdChanA;
    uint8 tdFilter;
   
    /* Configure the DMA to Transfer the data in 1 burst with individual trigger
     * for each burst.
     */
    channelHandle = DMA_DmaInitialize(BYTES_PER_BURST, REQUEST_PER_BURST,
                                        HI16(UPPER_SRC_ADDRESS), HI16(UPPER_DEST_ADDRESS));      
    channelFilter = DMA_DmaInitialize(BYTES_PER_BURST, REQUEST_PER_BURST,
                                        HI16(UPPER_SRC_ADDRESS), HI16(UPPER_DEST_ADDRESS));
   
    /* This function allocates a TD for use with an initialized DMA channel */
    tdChanA = CyDmaTdAllocate();                                                      
    tdFilter = CyDmaTdAllocate();
   
    /* Configure the tdChanA to transfer 1 byte with no next TD */
    CyDmaTdSetConfiguration(tdChanA, 1, tdChanA, DMA__TD_TERMOUT_EN);            
    CyDmaTdSetConfiguration(tdFilter, 1, tdFilter, DMA__TD_TERMOUT_EN);
   
    /* Set the source address as ADC_DelSig and the destination as
     * Filter Channel A.
     */
    CyDmaTdSetAddress(tdChanA, LO16((uint32)ADC_DelSig_DEC_SAMP_PTR), LO16((uint32)Filter_STAGEAH_PTR));     
    CyDmaTdSetAddress(tdFilter, LO16((uint32)Filter_HOLDA_PTR), LO16((uint32)VDAC8_Data_PTR));
   
    /* Set tdChanA to be the initial TD associated with channelHandle */
    CyDmaChSetInitialTd(channelHandle, tdChanA);                                         
    CyDmaChSetInitialTd(channelFilter, tdFilter);
   
    /* Enable the DMA channel represented by channelHandle and preserve the TD */
    CyDmaChEnable(channelFilter, 1);
    CyDmaChEnable(channelHandle, 1);    
   
    //Filter_COHER_REG = 0xAA;
    Filter_SetCoherency(Filter_CHANNEL_A, 0xAA);
   
}

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I see two DMA objects on your schematic page, "DMA" and "DMA_Filter".

   

 

   

In DMA_Config I see you only handle "DMA" object ? For example I never see you use -

   

 

   

   

uint8 DMA_Filter_DmaInitialize(uint8 BurstCount, uint8 ReqestPerBurst, uint16 UpperSrcAddress, uint16 UpperDestAddress) ;

   

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

Thanks! Let me try.

0 Likes
Anonymous
Not applicable

It is working now.

0 Likes