• AVR Freaks

lcd program doesn't work

Author
aviator3679
New Member
  • Total Posts : 27
  • Reward points : 0
  • Joined: 2019/08/22 13:32:23
  • Location: 0
  • Status: offline
2019/08/23 11:30:34 (permalink)
0

lcd program doesn't work

Hello,
I am trying to interface an lcd display LM016L to my pic18f2620, just learning as a student from a youtube tutorial, and i don't know why but the ide doesn't recognise the code. I am using mplab x ide v5.25 and the compiler is xc8 v2.05. In the main function,the ide says on the left side of every function i put...Unable to resolve identifier......When i build it,BUILD failed.The code i used is:
 
#include <stdio.h>
#include <stdlib.h>
#include "lcd.h"
void init_XLCD(void);
void DelayFor18TCY(void);
void DelayPORXLCD(void);
void DelayXLCD(void);
void main(void){
init_XLCD();
putrsXLCD("StudentCompanion");
SetDDRamAddr(0x40);
putrsXLCD("LCD DISPLAY");
while(1){
}
}
void init_XLCD (void){
OpenXLCD(FOUR_BIT & LINES_5X7);
while(BusyXLCD());
WriteCmdXLCD(0x06);
WriteCmdXLCD(0x00);
}
void DelayFor18TCY(void){
Nop(); Nop(); Nop(); Nop();
Nop(); Nop(); Nop(); Nop();
Nop(); Nop(); Nop(); Nop();
Nop(); Nop();
return;
}
void DelayPORXLCD(void){
Delay1KTCYx(30);
}
void DelayXLCD(void){
Delay1KTCYx(10);
}
 
 
when i build it this this what it says:
 
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'C:/Users/aeros/MPLABXProjects/lcd.X'
make -f nbproject/Makefile-default.mk dist/default/production/lcd.X.production.hex
make[2]: Entering directory 'C:/Users/aeros/MPLABXProjects/lcd.X'
"C:\Program Files (x86)\Microchip\xc8\v2.05\bin\xc8-cc.exe" -mcpu=18F2620 -c -fno-short-double -fno-short-float -memi=wordwrite -fasmfile -maddrqual=ignore -xassembler-with-cpp -mwarn=0 -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-download -mdefault-config-bits -std=c99 -gdwarf-3 -mstack=compiled:auto:auto:auto -o build/default/production/lcd.p1 lcd.c
lcd.c:20:5: warning: implicit declaration of function 'putrsXLCD' is invalid in C99 [-Wimplicit-function-declaration]
putrsXLCD("StudentCompanion");
^
lcd.c:21:5: warning: implicit declaration of function 'SetDDRamAddr' is invalid in C99 [-Wimplicit-function-declaration]
SetDDRamAddr(0x40);
^
lcd.c:30:5: warning: implicit declaration of function 'OpenXLCD' is invalid in C99 [-Wimplicit-function-declaration]
OpenXLCD(FOUR_BIT & LINES_5X7);
^
lcd.c:30:14: error: use of undeclared identifier 'FOUR_BIT'
OpenXLCD(FOUR_BIT & LINES_5X7);
^
lcd.c:30:25: error: use of undeclared identifier 'LINES_5X7'
OpenXLCD(FOUR_BIT & LINES_5X7);
^
lcd.c:31:11: warning: implicit declaration of function 'BusyXLCD' is invalid in C99 [-Wimplicit-function-declaration]
while(BusyXLCD());
^
lcd.c:32:5: warning: implicit declaration of function 'WriteCmdXLCD' is invalid in C99 [-Wimplicit-function-declaration]
WriteCmdXLCD(0x06);
^
lcd.c:45:5: warning: implicit declaration of function 'Delay1KTCYx' is invalid in C99 [-Wimplicit-function-declaration]
Delay1KTCYx(30);
^
6 warnings and 2 errors generated.
(908) exit status = 1
nbproject/Makefile-default.mk:107: recipe for target 'build/default/production/lcd.p1' failed
make[2]: Leaving directory 'C:/Users/aeros/MPLABXProjects/lcd.X'
nbproject/Makefile-default.mk:91: recipe for target '.build-conf' failed
make[1]: Leaving directory 'C:/Users/aeros/MPLABXProjects/lcd.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make[2]: *** [build/default/production/lcd.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
 
 
Thank you in advance!!!
#1

1 Reply Related Threads

    katela
    Super Member
    • Total Posts : 1378
    • Reward points : 0
    • Joined: 2013/06/11 05:25:18
    • Location: South Africa
    • Status: online
    Re: lcd program doesn't work 2019/08/23 11:38:41 (permalink)

    Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
    YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5