• AVR Freaks

Hot!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/22 19:15:41 (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 files are below:
 
#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

11 Replies 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:37:31 (permalink)
    5 (1)
    You are using a new compiler XC8 v2.05 doesn't support the peripheral library (plib) anymore that's why your lcd functions are not recognized. 
    You can either install the older XC8 version that supported the plib, v1.34 or from v1.35 to v1.45  you can download separately the plib they are now called Legacy Peripheral Library from XC8 download page. 
    You can search the forums for many threads discussing this same topic.

    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
    du00000001
    Just Some Member
    • Total Posts : 2998
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: lcd program doesn't work 2019/08/23 13:09:01 (permalink)
    0
    Addition:
    Switching to C90 mode might somewhat improve the situation.
     
    ??? "aviator..." == "crash pilot" ???

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #3
    aviator3679
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/08/22 13:32:23
    • Location: 0
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 07:15:23 (permalink)
    0
    to katela
     
    I tried to download xc8 v1.34 but i cant find it anywhere 
     
    to du00000001
     
    i already had to switched to c90 but it didnt do anything
     
     
     
    #4
    du00000001
    Just Some Member
    • Total Posts : 2998
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 07:25:35 (permalink)
    5 (1)
    Your logs provided indicate C99. If you tried C90, the messages would be different.
    If so: tell us the whole story of what you did - not just snippets  :(
     
    The compiler archive is somewhat tricky to find:
    https://www.microchip.com...spic-downloads-archive

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #5
    aviator3679
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/08/22 13:32:23
    • Location: 0
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 09:57:32 (permalink)
    0
    to du00000001
     
    What I have done until now is that I changed the settings to c90,I also downloaded mplab x ide v2.05 just in case,but even in archives there is no xc8 v1.34 compiler. Thats what Ive tried till now but nothing worked,sorry for giving the info in piecies, i haven t really participated in other forums before...its my first time...be gentle...haha. Anyways bottomline i have done some research on this forum and found some people that had the exact same problem, they all solved it by downloading xc8 v1.34 compliler and basically this is what i cant find even in the archives.
    post edited by aviator3679 - 2019/08/24 09:58:50
    #6
    mbrowning
    Just a Member
    • Total Posts : 1504
    • Reward points : 0
    • Joined: 2005/03/16 14:32:56
    • Location: Melbourne, FL
    • Status: online
    Re: lcd program doesn't work 2019/08/24 10:03:56 (permalink)
    5 (1)
    I just looked in

    https://www.microchip.com...spic-downloads-archive

    And I see all three flavors of 1.34

    Oh well - there's always next year
    #7
    Jim Nickerson
    User 452
    • Total Posts : 6185
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: online
    Re: lcd program doesn't work 2019/08/24 10:08:24 (permalink)
    0
    aviator3679
    to du00000001
     
    What I have done until now is that I changed the settings to c90,I also downloaded mplab x ide v2.05 just in case,but even in archives there is no xc8 v1.34 compiler. Thats what Ive tried till now but nothing worked,sorry for giving the info in piecies, i haven t really participated in other forums before...its my first time...be gentle...haha. Anyways bottomline i have done some research on this forum and found some people that had the exact same problem, they all solved it by downloading xc8 v1.34 compliler and basically this is what i cant find even in the archives.


    I also see 1.34 in the archives following the link provided by du00000001
    #8
    du00000001
    Just Some Member
    • Total Posts : 2998
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 10:35:14 (permalink)
    0
    For the crash pilot: here's the link for the Win version:
    http://ww1.microchip.com/...-windows-installer.exe

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #9
    aviator3679
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/08/22 13:32:23
    • Location: 0
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 11:36:13 (permalink)
    0
    I am trying to find it in the archives but i dont, can you give a screenshot of about where it is on the page or under which section it  is. I am searching under the...MPLAB C Compiler for PIC18...section but xc8 v1.34 is not there
    #10
    1and0
    Access is Denied
    • Total Posts : 9607
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 11:53:43 (permalink)
    5 (1)
    aviator3679
    I am trying to find it in the archives but i dont, can you give a screenshot of about where it is on the page or under which section it  is. I am searching under the...MPLAB C Compiler for PIC18...section but xc8 v1.34 is not there

    You wanted XC8, so look under MPLAB XC8.
    #11
    aviator3679
    New Member
    • Total Posts : 27
    • Reward points : 0
    • Joined: 2019/08/22 13:32:23
    • Location: 0
    • Status: offline
    Re: lcd program doesn't work 2019/08/24 12:06:51 (permalink)
    5 (1)
    I found it,i downloaded it and the code works perfect!!!!!!!THANK YOU ALL!!!!!!!!!!!!!!
    #12
    Jump to:
    © 2019 APG vNext Commercial Version 4.5