- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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