2 ADC >> 2 DMA >> Filter >> 2 DAC

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

Hi everyone;

   

I want to filter 2 signal sequentially. My purpose is to get values from 2 ADC and send them filter with 2 DMA. After that I receive them from filter with DMA and I will separate signals and I send them to 2 DAC. There is no problem to send values to filter. But I can't separate them. Do you have any idea that how can I do ? Also are there anyway to add offset to output of filter ?

   

I can add them into interrupt with VDAC8_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u); but I need on DMA request.

Thanks for your advices
 

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

The filter has two channels maybe that will solve your problem. You cannot mix signals from different sources into the filter and separate them again.

   

Adding an offset could be done using DMA only by creating a DMA capable component yourself using verilog. Not quite easy, but doable.

   

 

   

Bob

0 Likes
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted
        burakyasin, The Filter has 2independent channels, it should be possible to filter 2 ADC signals separately. For direct DMA transfer Filter->DAC watch "How to Create an Analog Filter with PSoC 5LP" on YouTube: https://youtu.be/oq8eQhvkceM   
0 Likes
Anonymous
Not applicable
        Thanks for reply Actually I didn't want to use 2 Channels of filter because I dont want to decrease filter tabs on it. Because when use 2 Channels, need to decrease it. Lastly, I use 2 adc>>2dma>>1emfile combination. With them, I wrote on sd card 4000 sample from fırst adc, 4000 sample for second adc sequentally with dmas. I just thought that I can use same strategy for filter.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Actually, I can see output of the dac which seems 256 byte from first ADC -256 byte from second ADC. However I want to put index between them. When index is 0, Results shown from first DAC, when index is 1, results shown from second DAC. (In the oscilloscope output you can see my first ADC connect to signal generator, second ADC connect to GND)

For this I put my code between my TD's, which shown on pictures. But I couldn't give value my "ptr3" on my codes.
Do you have any idea about that too ?

Thanks
Burak

   

   

   

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

Are you sure this is correct?
The filter has a memory of previous values of the signal.
If you switch the input source of the filter does not know about it.
at the output of the filter appears a mess of two signals.
I will not tell the length distortion when taps = 128
Maybe easier to use one ADC, Filter and DAC and multiplexer at input and output.

0 Likes
lock attach
Attachments are accessible only for community members.
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

Where should the embed code? In DAC out?
Then maybe so?

   

0 Likes
Anonymous
Not applicable

Actually, I used another method to do. In for loop, I am stopping DMA's sequencally. With them I had something less complex and more useful. However, I still think to obtain with filter>>DMA. Read 128 and write it on DAC1 then again read and write on DAC2. But with this result shown meaningless. 
In for loop;
      CyDmaChEnable(DMA_Chan, 1);
        CyDmaChDisable(DMA_2_Chan);
        i=1;
        
        
        CyDelay(1000);
        CyDmaChEnable(DMA_2_Chan, 1);
        CyDmaChDisable(DMA_Chan);
        i=0;
        
      CyDelay(1000);

   

In ISR;

   

   if(i==1)
    VDAC8_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);
   if(i==0)
    VDAC8_1_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);

0 Likes
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

I think I do not understand you. How do you plan to separate 2 signals on the same channel?

0 Likes
Anonymous
Not applicable

apologize for my late reply,

   

My plan is 

   

With two dma of the output, I will send them on dac or somewhere.

   


CyDmaTdSetAddress(DMA_1_TD[0], LO16((uint32)Filter_HOLDAH_PTR), LO16((uint32)VDAC8_Data_PTR));
CyDmaTdSetAddress(DMA_1_TD[1], LO16((uint32)Filter_HOLDAH_PTR), LO16((uint32)VDAC8_Data_PTR));
CyDmaTdSetAddress(DMA_1_TD[2], LO16((uint32)Filter_HOLDAH_PTR), LO16((uint32)VDAC8_1_Data_PTR));
CyDmaTdSetAddress(DMA_1_TD[3], LO16((uint32)Filter_HOLDAH_PTR), LO16((uint32)VDAC8_1_Data_PTR));

   

Input of Filter is

   

CyDmaTdSetConfiguration(DMA_TD[0], 2000, DMA_TD[1], DMA__TD_TERMOUT_EN );
CyDmaTdSetConfiguration(DMA_TD[1], 2000, DMA_2_TD[0], DMA__TD_TERMOUT_EN );
CyDmaTdSetConfiguration(DMA_2_TD[0], 2000, DMA_2_TD[1], DMA_2__TD_TERMOUT_EN);
CyDmaTdSetConfiguration(DMA_2_TD[1], 2000, DMA_TD[0], DMA_2__TD_TERMOUT_EN); 

   

 

   

So, with this configuration, I will send my signals sequentally, after I will receive my signals sequentally. With optimization.

Or I will stop one of DMA from input of filter and receive data from filter after I will stop another DMA from input.
But when I send output of DMA which come from output of filter to the SD card. But my results are between 0-200 with 12 bit DMA. Is it normal or my DMA's dont work ? (ADC input is 4kHZ square wave) 

0 Likes
lock attach
Attachments are accessible only for community members.
EvPa_264126
Level 7
Level 7
500 replies posted 250 replies posted 100 likes received

Concerning + 128u:
You can  use Control_Reg instead Filter_Read8 (Filter_CHANNEL_A) + 128u

0 Likes
kep_284046
Level 2
Level 2
First like given

Merhabalar Burak,

   

Psoc konusunda paslaşacağım arkadaşlara ihtiyacım var. Sende istersen tanışabilir miyiz?

0 Likes
Anonymous
Not applicable

Hello Burakyasin 

   

I want to learning about these chase, 2 ADC >> 2 DMA >> Filter >> 2 DAC

   

I have project for 2 chanel signal processing from detector, Can i discuse with you about this project? I'm just 14 days using PSoC from early, 

   

This is my active email, donielianr@gmail.com. Very big thanks if we can discuse. My apologize if my english so poor.

   

Best Regard

   

Doni Elian

0 Likes