sukumar
Junior Member level 3
Hi all,
The following code throws
Can anybody help me. i cannot include plib.h properly. Or Pls tell me how to use peripheral library in my code. I am using PIC18F67J50
The following code throws
Error [499] ; 0. undefined symbol: _OpenADC(ADC.obj)
Can anybody help me. i cannot include plib.h properly. Or Pls tell me how to use peripheral library in my code. I am using PIC18F67J50
Code:
#include<htc.h>
#include<plib.h>
#include<stdio.h>
#include "UART.c"
__CONFIG(1,0xF796 & DEBUGDIS); //XINSTDIS & DEBUGDIS & STVRDIS & PLLDIV10 & WDTDIS & CPUDIV2 & UNPROTECT);
__CONFIG(2,IESODIS & FCMDIS & HSPLL & WDTPS1);
unsigned int Convert_ADC(void);
void main(void)
{
unsigned int result;
serial_init();
OpenADC(ADC_FOSC_2 & ADC_LEFT_JUST & ADC_2_TAD, ADC_CH0 & ADC_INT_OFF & ADC_REF_VDD_VSS, ADC_1ANA);
while(1)
{
result = Convert_ADC();
printf("%d",result);
}
}
unsigned int Convert_ADC(void)
{
unsigned int result;
ConvertADC();
while (BusyADC());
result = ReadADC();
CloseADC();
return result;
}
void putch(unsigned char chr) //Function Called by Printf
{
Transmit(chr);
}