+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Junior Member level 3
    Points: 1,693, Level: 9

    Join Date
    Nov 2006
    Posts
    31
    Helped
    1 / 1
    Points
    1,693
    Level
    9

    Hi-Tech PICC18 Peripheral library problem

    Hi all,

    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
    #include
    #include
    #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);
    }

    •   AltAdvertisement

        
       

  2. #2
    Advanced Member level 3
    Points: 5,367, Level: 17

    Join Date
    Jul 2009
    Posts
    734
    Helped
    82 / 87
    Points
    5,367
    Level
    17

    Re: Hi-Tech PICC18 Peripheral library problem

    you have to link in the library.

    or copy the source code to your project folder.



    •   AltAdvertisement

        
       

  3. #3
    Junior Member level 3
    Points: 1,693, Level: 9

    Join Date
    Nov 2006
    Posts
    31
    Helped
    1 / 1
    Points
    1,693
    Level
    9

    Re: Hi-Tech PICC18 Peripheral library problem

    Hi millwood,

    Thanks for your reply. I will try to copy the source code.
    but how(what is) to link the library. Really i dont know? Any example.

    I thought it would be better to link the library.

    copying the source code is working now. Thank you very much.
    Last edited by sukumar; 13th September 2010 at 18:33.



    •   AltAdvertisement

        
       

  4. #4
    Advanced Member level 3
    Points: 5,367, Level: 17

    Join Date
    Jul 2009
    Posts
    734
    Helped
    82 / 87
    Points
    5,367
    Level
    17

    Re: Hi-Tech PICC18 Peripheral library problem

    Really i dont know?
    read the compiler / ide manuals would be greatly helpful to you.



  5. #5
    Junior Member level 3
    Points: 1,693, Level: 9

    Join Date
    Nov 2006
    Posts
    31
    Helped
    1 / 1
    Points
    1,693
    Level
    9

    Re: Hi-Tech PICC18 Peripheral library problem

    Hi millwood,

    For linking the library, Just Goto Build Options-->Project-->Linker Tab-->Check the box "Link in peripheral library". It solved my problem.
    Thank you very much for ur valuable idea.

    ---------- Post added at 03:51 AM ---------- Previous post was at 03:21 AM ----------

    similar problem faced here,
    HI-TECH Software Forums: Problem with including peripheral library in Hitech c 18 v 9.63



    •   AltAdvertisement

        
       

  6. #6
    Advanced Member level 3
    Points: 5,367, Level: 17

    Join Date
    Jul 2009
    Posts
    734
    Helped
    82 / 87
    Points
    5,367
    Level
    17

    Re: Hi-Tech PICC18 Peripheral library problem

    that's right. you need to link plib, as specified in the ide manual.

    HI-TECH Software Forums: Problem with including peripheral library in Hitech c 18 v 9.63
    don't take that place seriously: many of those 'experts" there don't know simple issues like "read-modify-write".



--[[ ]]--