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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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.

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Anton,

You can find similar project and discussion (DelSig_ADC-Filter-DAC8) here

Class D adcDelSig>Filter>Pwm using DMA only

You would only have to update to SAR_ADC, which should not be a problem.

/odissey1

View solution in original post

0 Likes
2 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Anton,

You can find similar project and discussion (DelSig_ADC-Filter-DAC8) here

Class D adcDelSig>Filter>Pwm using DMA only

You would only have to update to SAR_ADC, which should not be a problem.

/odissey1

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

Depending on your filter configuration you will need several ADC values before a filter output is ready. Better avoid the while-loop within an interrupt handler and check for data ready in your main-loop.

Bob