8 Replies Latest reply on Nov 25, 2019 3:55 AM by Roka_4525941

    psoc5 filter issue

    Roka_4525941

      Hi All,

      I'm working with psoc5 (CY8C5888LTI-LP097) I want to use two filters per design so  when i used two filters it is giving an error as Resource limit: Maximum number of Digital Filter Block exceeded (max=1, needed=2). (App=cydsfit).

      please can any one tell me that  I can use two filters or not what is the solution for this?

      Regards,

      Roopa

        • 1. Re: psoc5 filter issue
          EktaN_26

          Hello Roopa,

           

          It is not possible to use two Digital filter Blocks in your project due to resource limitation.

          However, the Digital signal Block supports upto two data streaming channels, therefore you can use a single DFB block to process two inputs.

          Can you please provide more details about your requirement?

           

          Best Regards

          Ekta

          • 2. Re: psoc5 filter issue
            Roka_4525941

            Hi EktaN_26,

             

            I'm trying to transfer the ADC result to two  filter channels through filter ISR(A and B).But simultenuosly ISR is not coming for two channels.

            in A channel I'm transferring I Channel data and in  B channel Im transferring  Q channel  data.

             

            Filter ISR is coming only for I Channel when Q channel data  is commented and vice versa.

            Regards,

            Roopa

            • 3. Re: psoc5 filter issue
              Roka_4525941

              Hi EktaN_26,

              sorry i want to use  filter not the digital filter block.i tried with both then also im having this resource limitation .

              I'm trying to transfer the ADC result to   filter channels through filter ISR(A and B).But simultenuosly ISR is not coming for two channels.

              in A channel I'm transferring I Channel data and in  B channel Im transferring  Q channel  data.

               

              Filter ISR is coming only for I Channel when Q channel data  is commented and vice versa.

              Regards,

              Roopa

              • 4. Re: psoc5 filter issue
                EktaN_26

                Hello Roopa,

                 

                You can use the following code to differentiate between the interrupt cause is due to A channel or B channel or due to both the channels.

                 

                #include "project.h"

                uint8 flag_A = 0;

                uint8 flag_B = 0;

                CY_ISR(MY_ISR)

                {

                    flag_A = Filter_IsInterruptChannelA();

                    flag_B = Filter_IsInterruptChannelB();

                    Filter_ClearInterruptSource();

                    ISR_ClearPending();

                }

                 

                int main(void)

                {

                    CyGlobalIntEnable; /* Enable global interrupts. */

                    Filter_Start();

                    CY_ISR_PROTO(MY_ISR);

                    ISR_StartEx(MY_ISR);

                    for(;;)

                    {

                        if(flag_A != 0 && flag_B == 0)

                        {

                        /*USER CODE IF INTERRUPT SOURCE IS A*/

                        flag_A = 0;

                        /*Set the interrupt Flag_A to zero*/ 

                        }

                       

                        if(flag_B != 0 && flag_A == 0)

                        {

                        /*USER CODE IF INTERRUPT SOURCE IS B*/

                        flag_B = 0;

                        /*Set the interrupt Flag_B to zero*/ 

                        }

                       

                        if(flag_A != 0 && flag_B !=

                0)

                        {

                        /* USER CODE IF INTERRUPT SOURCE IS BOTH A AND B*/

                        flag_A = 0;

                        flag_B = 0;

                        }

                    }

                }

                 

                 

                I have connected an ISR to the interrupt pin of the filter block as shown in the image below:

                Please let me know if the above solution works for you.

                 

                Best Regards

                Ekta

                • 5. Re: psoc5 filter issue
                  Roka_4525941

                  Hi EktaN_26,

                  I tried your code to differentiate between the interrupt cause is due to A channel or B channel or due to both the channels.

                  after debugging the code break point is setting at all the  if conditions as shown in below figures.FLAGA NOT B.PNG

                  FLAGB NOT A.PNG

                  BOTHAB.PNG

                  And I also found one thing that breakpoint did not come at filterISR as shown in below figure.

                  FILTER ISR.PNG

                  So I'm not getting why the filterISR  is not coming .Can you give some pointers for this?

                  • 6. Re: psoc5 filter issue
                    Roka_4525941

                    Hi Ektan_26,

                    Please can you give response for the query?

                    Regards,

                    Roopa

                    • 7. Re: psoc5 filter issue
                      EktaN_26

                      Hi Roopa,

                       

                      Can you please attach your original project so that I can make similar changes in it and test this at my end?

                       

                      Regards

                      Ekta

                      • 8. Re: psoc5 filter issue
                        Roka_4525941

                        Hi EktaN_26,

                        Sorry for the late reply.I have attached my original code.named as ADC_SAR_PRSIM which as an example code. I have modified this code according to my application. In this code I am passing the adc result (I and Q) to filter channels (A and B).adcISR comes to the adc.

                        But filterISR is not coming to the filter.when both I and Q code is enabled.

                        filterISR comes to the filter only when I is enabled and Q code is commented and vice versa.

                         

                        here I have attached the main code with the screenshot of schematics.

                        here in schematics ,I have given WDOP output to input of ADC(pin_vin)  means I have connected the WDOP pin directly to Pin_Vin pin the psoc board.

                        topdesign schematics.PNG

                         

                        https://drive.google.com/file/d/1ZJD_KVQ-ASsG2T9W0W7KYxLtidVl3LHO/view?usp=sharing

                        TopDesign.cysch - Google Drive