Hello Every One,
I am trying to implement polling method for channel A and channel B of my filter.
I am following and example project. This project is written for Channel A only. I have some confusion in it. I wrote the following code for channel A and B. Kindly tell me if am i am doing it write:
I am doing the following:
ADC---->Filter---->DAC.
Code:
#include <device.h>
#include <VDAC8.h>
#include <math.h>
#include <stdio.h>
void DMA_ADC_ChA_Config(void);
void DMA_ADC_ChB_Config(void);
int main()
{
ADC_ChA_Start();
ADC_ChA_IRQ_Start();
ADC_ChA_StartConvert();
ADC_ChB_Start();
ADC_ChB_IRQ_Start();
ADC_ChB_StartConvert();
VDAC_ChA_Start();
VDAC_ChB_Start();
Filter_Start();
Filter_INT_CTRL_REG |= (1 << Filter_CHANNEL_A);
Filter_INT_CTRL_REG |= (2 << Filter_CHANNEL_B); (IS THIS COMMAND IS CORRECT FOR CHANNEL B?)
DMA_ADC_ChA_Config();
DMA_ADC_ChB_Config();
/* Enable Global Interrupts */
CYGlobalIntEnable;
for(;;)
{
while (Filter_IsInterruptChannelA() == 0) ;
VDAC_ChA_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);
while (Filter_IsInterruptChannelB() == 0);
VDAC_ChB_SetValue(Filter_Read8(Filter_CHANNEL_B) + 128u);
}
} /* End of main
Looking forward for your reply.
Awais