Shouldn't the call ave 2 args? Config and config2 are listed in the c18 libraries manual. Matt On 4 Oct 2012 19:43, "Yigit Turgut" wrote: > Hi folks, > > I have a piece-of-cake question for the most of you ; > > For some test purposes I am trying to implement some stuff in a > 18f452. By referring to datasheet (39564c.pdf ~ 5.7Mb) I think I am > not able to set the correct bits right. For the initial test I tried > to use the built-in function of the C18 compiler, my other routines > work perfectly well except the lousy internal ADC. For the test ; > > > #include > #include > #include > > unsigned int result; > > void main( void ) > { > TRISA =3D 1 ; > TRISB =3D 0; > LATBbits.LATB6 =3D 0; > > OpenADC( ADC_FOSC_32 & ADC_RIGHT_JUST & ADC_8ANA & ADC_CH1 & ADC_INT_OFF = ); > Delay10TCYx( 5 ); > > ConvertADC(); > > while( BusyADC() ){ > result =3D ReadADC(); > if(result<=3D512){ > LATBbits.LATB6 =3D 1; > Delay10TCYx( 5 );} > } > } > > Internal ADC of this device is 10bits thus should provide a value > between 0-1023. Threshold is chosen exactly in the middle thus I can > check if the routine works by applying 0V and 5V to AN0. The problem > is ; it doesn't work (chinn chinn). I succeded following the same > methodology at other devices from Microchip but no luck with the > 18f452. I think it's an older device thus the datasheet I mentioned > above might be incompatible at a point or more with latest versions of > C18 and MpLabX. > > Exact error when compiling this unbelievable short code is ; > > too few arguments in function call > > in the OpenADC function. > > When checked out the C18 documents, it is clearly stated that these > configurations for OpenADC should suffice. > > I wanted to have opinions that can save me some time before I believe > this thing worth digging deeper. > > Have a nice day. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .