Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] error :undefined symbol

Status
Not open for further replies.

beauty world

Newbie level 5
Joined
Jun 22, 2015
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
46
Hi.Im learning PIC and I use PIC18f45k22 for voltmeter with LCD display project.but the program has erroe that I cant solve it

:: warning: (1273) Omniscient Code Generation not available in Free mode
:0: error: (499) undefined symbol:
_DelayFor18TCY(dist/default/production\lcd_voltmeter.X.production.obj)
make[2]: *** [dist/default/production/lcd_voltmeter.X.production.hex] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
(908) exit status = 1
nbproject/Makefile-default.mk:119: recipe for target 'dist/default/production/lcd_voltmeter.X.production.hex' failed
make[2]: Leaving directory 'D:/PIC MICRO/my prj/lcd voltmeter/lcd voltmeter.X'
nbproject/Makefile-default.mk:78: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/PIC MICRO/my prj/lcd voltmeter/lcd voltmeter.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed

BUILD FAILED (exit value 2, total time: 1s)

what should I do?
 
Last edited by a moderator:

To provide solution we have to see your code. So, zip and post the complete MPLAB X project files. Have you installed proper toolset for using with MPLAB X. That is have you installed a Compiler to work with MPLAB X ?
 

You seem to be missing the function "_DelayFor18TCY()" or possibly it is there but it's function prototype is missing.

Brian.
 

It's a typing mistake!

The error message says it can't find "DelayFor18TCY()" but the function you have created is:
Code:
//this function creat 18cycle delay for xlcd library
void Delay[B][COLOR=#FF0000]f[/COLOR][/B]or18TCY(void){
    Delay10TCYx(20);
}

Brian.
 

I make it but agan that error :(
ny code is this:
Code:
#include<xc.h>
#include<delays.h>
#include<stdlib.h>
#include<xlcd.h>
#include<adc.h>


#define _XTAL_FREQ 8000000
#pragma config MCLRE=EXTMCLR,FOSC=HSHP,WDTEN=OFF

void Delay_second(unsigned char s){
    unsigned char i,j;
    for(j=0;j<s;j++){
        for(i=0;i<100;i++)__delay_ms(10);}

}

void DelayFOR18TCY(void){
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();
    return;}

void DelayPORXLCD(void){           //15ms delay
    Delay1KTCYx(30);
}

void DelayXLCD(void){            //5ms delay

}

void LCD_Clear(){
    while(BusyXLCD());
    WriteCmdXLCD(0x01);

}
void LCD_Move(unsigned char row,unsigned char column){
    char ddaddr=40*(row-1)+column;
    while(BusyXLCD());
    SetDDRamAddr(ddaddr);

}

void main(){
    unsigned char vin,mv;
    char op[10];
    TRISB=0;              //PORT B CONFIGUR AS OUTPUT
    TRISAbits.RA0=1;      //PIN A0 configure as input
    ANSELB=0;             //PORT B config as digital
    ANSELA=1;



    Delay_second(1);
    OpenXLCD(FOUR_BIT&&LINE_5X7);


    OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST &ADC_20_TAD,
            ADC_CH0& ADC_INT_OFF ,
            ADC_TRIG_CTMU &ADC_REF_VDD_VDD &ADC_REF_VDD_VSS);

    while( BusyXLCD());        //wait if the lcd is busy
    WriteCmdXLCD(DON);        //desplay lcd on
     while( BusyXLCD());        //wait if the lcd is busy
      WriteCmdXLCD(0x06);
      putrsXLCD("VOLTMETER");
      Delay_second(2);
      LCD_Clear();

      for(;;){
          LCD_Clear();
          SelChanConvADC(ADC_CH0);
           while( BusyXLCD());
           vin=ReadADC();
          mv=(vin*5000)>>10;
          LCD_Move(1,1);
          putrsXLCD("mv=");
          mv=(vin*5000)>>10;
          itoa(op,mv,10);

          LCD_Move(1,6);
          putrsXLCD(op);
          Delay_second(1);
      }
}
 
Last edited by a moderator:

Read the error message carefully and consider that C language is case sensitive. Correct the definition of DelayFOR18TCY() respectively.
 
I chamge it but again the same error :(
the code that I use is this:
Code:
[CODE]
#include<xc.h>
#include<delays.h>
#include<stdlib.h>
#include<xlcd.h>
#include<adc.h>


#define _XTAL_FREQ 8000000
#pragma config MCLRE=EXTMCLR,FOSC=HSHP,WDTEN=OFF

void Delay_second(unsigned char s){
    unsigned char i,j;
    for(j=0;j<s;j++){
        for(i=0;i<100;i++)__delay_ms(10);}

}

void DelayFOR18TCY(void){
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();  NOP();  NOP();
    NOP();  NOP();
    return;}

void DelayPORXLCD(void){           //15ms delay
    Delay1KTCYx(30);
}

void DelayXLCD(void){            //5ms delay
__delay_ms(5);
}

void LCD_Clear(){
    while(BusyXLCD());
    WriteCmdXLCD(0x01);

}
void LCD_Move(unsigned char row,unsigned char column){
    char ddaddr=40*(row-1)+column;
    while(BusyXLCD());
    SetDDRamAddr(ddaddr);

}

void main(){
    unsigned char vin,mv;
    char op[10];
    TRISB=0;              //PORT B CONFIGUR AS OUTPUT
    TRISAbits.RA0=1;      //PIN A0 configure as input
    ANSELB=0;             //PORT B config as digital
    ANSELA=1;



    Delay_second(1);
    OpenXLCD(FOUR_BIT&&LINE_5X7);


    OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST &ADC_20_TAD,
            ADC_CH0& ADC_INT_OFF ,
            ADC_TRIG_CTMU &ADC_REF_VDD_VDD &ADC_REF_VDD_VSS);

    while( BusyXLCD());        //wait if the lcd is busy
    WriteCmdXLCD(DON);        //desplay lcd on
     while( BusyXLCD());        //wait if the lcd is busy
      WriteCmdXLCD(0x06);
      putrsXLCD("VOLTMETER");
      Delay_second(2);
      LCD_Clear();

      for(;;){
          LCD_Clear();
          SelChanConvADC(ADC_CH0);
           while( BusyXLCD());
           vin=ReadADC();
          mv=(vin*5000)>>10;
          LCD_Move(1,1);
          putrsXLCD("mv=");
          mv=(vin*5000)>>10;
          itoa(op,mv,10);

          LCD_Move(1,6);
          putrsXLCD(op);
          Delay_second(1);
      }
}

[/CODE]
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top