2 Replies Latest reply on Apr 6, 2018 11:51 AM by bob.marlowe

    Why I don't get any filter interrupt? Neither when using "Polled" nor when using "Interrupt request" output

    anton.sarg_3291771

      Hi,

       

      I am struggling for days now and can't find any solution.

       

      I simply want to read a sine wave with an ADC_SAR, filter the signal with the built-in filter element and sent the result to a VDAC converter.

      schematic.PNG

      Here is the code I am using right now.

       

      #include "project.h"

       

      CY_ISR_PROTO(adc_isr_handler);

      CY_ISR(adc_isr_handler)

      {

          Pin_activeISR_Write(1);

           

          int8 iADC = ADC_SAR_GetResult8();

          Filter_Write8(Filter_CHANNEL_A, iADC );

         

          Filter_ClearInterruptSource();

          while (Filter_IsInterruptChannelA() == 0);

         

          int8 iFilterVal = Filter_Read8(Filter_CHANNEL_A);

          VDAC8_SetValue(iFilterVal);

             

          Pin_activeISR_Write(0);

      }

       

       

      int main(void)

      {

          adc_isr_StartEx(adc_isr_handler);

          CyGlobalIntEnable; /* Enable global interrupts. */

       

          Filter_Start();

          ADC_SAR_Start();

          VDAC8_Start();

        

          for(;;)

          {

             

          }

      }

       

      The problem is that the while-loop seems never want to end. I simply do not get any interrupt. Do I have to enable something else?
      I also have tried to use "interrupt request" in the filter settings and set up another isr. But this one also doesnt get fired.

       

      I would really appreciate any kind of suggestion!

      Thank you.