11 Replies Latest reply on Jul 18, 2017 9:05 PM by userc_43201

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

      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

        • 1. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

          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.





          • 2. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC
                    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   
            • 3. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC
                      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.   
              • 4. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                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 ?





                • 5. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                  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.

                  • 6. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

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


                    • 7. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                      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);
                              CyDmaChEnable(DMA_2_Chan, 1);


                      In ISR;


                          VDAC8_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);
                          VDAC8_1_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);

                      • 8. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

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

                        • 9. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                          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) 

                          • 10. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

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

                            • 11. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                              Merhabalar Burak,


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

                              • 12. Re: 2 ADC >> 2 DMA >> Filter >> 2 DAC

                                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