ADC1BUFx Undeclared Error in dspic33f programming

Status
Not open for further replies.

Honey15

New Member
Hello everyone,

I need some help with the ADC configuration of the dspic33fj128mc804 . I'm trying to configure ADC for 8 analog inputs such that they are sampled by one S&H channel CH0 (As given in 16.10.2 of data sheet). The problem I'm having is that when I try to read the result ADC1BUF1 ,ADC1BUF2..... ADC1BUF7, the program doesn't builds and the error shown is that all these buffers are undeclared.

Could anyone please help me with this? Any feedback is much appreciated!!

Many Thanks.

void initadc(void)
{
AD1PCFGL =0xff00;
AD1CSSL=0x00ff;
AD1CHS0=0;
AD1CON4=0;
AD1CON3=0x8001;
AD1CON2=0x0420;
AD1CON1=0x8406;// ASAM=1, SIMSAM=0
}


void __attribute__((auto_psv)) _AD1Interrupt(void)
{

adResults[0]=ADC1BUF1;//save
adResults[1]=ADC1BUF1;
adResults[2]=ADC1BUF2;
adResults[3]=ADC1BUF3;
adResults[4]=ADC1BUF4;
adResults[5]=ADC1BUF5;
adResults[6]=ADC1BUF6;
adResults[7]=ADC1BUF7;
shouldWriteResults =1;//set flag.

}
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…