• AVR Freaks

Hot!LCD Library

Page: 123 > Showing page 1 of 3
Author
didierleplae
Junior Member
  • Total Posts : 101
  • Reward points : 0
  • Joined: 2019/03/31 16:57:50
  • Location: 0
  • Status: offline
2019/11/18 11:59:17 (permalink)
0

LCD Library

Can anyone recommend a good LCD library for ST7066 or compatible LCD?
#1

51 Replies Related Threads

    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LCD Library 2019/11/18 12:20:00 (permalink)
    +1 (1)
    For which PIC family?
    PIC16 midrange?
    PIC16 enhanced?
    PIC18?
     
    Which language?
    ASM?
    C?
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/18 14:42:27 (permalink)
    0
    I've been trying to use PIC16F1765 but will probably move to something with higher pin count in the the 16F family.
    I wouldn't mind the flexibility to use a smaller chip when possible, though.
     
    C language.
    #3
    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LCD Library 2019/11/18 14:53:00 (permalink)
    +1 (1)
    The ST7066 is almost identical to HD44780.
    Here's a library intended for a PIC18F part, but should be minimal changes to work with an enhanced PIC16F chip.
    http://picforum.ric323.com/viewtopic.php?f=40&t=210
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    Mysil
    Super Member
    • Total Posts : 3488
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: LCD Library 2019/11/18 20:56:31 (permalink)
    +1 (1)
    Hi,
    Here is a thread with several suggestions:
    https://www.microchip.com/forums/FindPost/961729
     
    I have used the library published by: vloki
    It have good descriptions, and may be configured to use any selection of pins.
    There are sample configurations for several combinations of controllers and displays:
    https://www.microchip.com/forums/FindPost/961752
    Edit: It point to the same article and code as suggested by ric in message #4 above.
     
        Mysil
    post edited by Mysil - 2019/11/20 07:07:35
    #5
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/19 16:46:43 (permalink)
    0
    ric
    The ST7066 is almost identical to HD44780.
    Here's a library intended for a PIC18F part, but should be minimal changes to work with an enhanced PIC16F chip.
    http://picforum.ric323.com/viewtopic.php?f=40&t=210
     


    Thank you!
    I did try this out and wasn't having any luck. I will have another look this evening and post the changes I made to your code to see if you think it makes sense.
    #6
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/19 16:47:57 (permalink)
    0
    Mysil
    Hi,
    Here is a thread with several suggestions:
    https://www.microchip.com/forums/FindPost/961729
     
    I have used the library published by: vloki
    It have good descriptions, and may be configured to use any selection of pins.
    There are sample configurations for several combinations of controllers and displays:
    https://www.microchip.com/forums/FindPost/961752
     
        Mysil


    Thanks! Haven't had a chance to look through this stuff yet but will check it out
    #7
    Mysil
    Super Member
    • Total Posts : 3488
    • Reward points : 0
    • Joined: 2012/07/01 04:19:50
    • Location: Norway
    • Status: offline
    Re: LCD Library 2019/11/20 07:19:55 (permalink)
    0
    Hi,
    The second link in message above, and in message #4,
    point to the same article and LCD software, as suggested by ric in message #4.
     
        Mysil
    #8
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/20 17:02:06 (permalink)
    0
    Mysil
    Hi,
    The second link in message above, and in message #4,
    point to the same article and LCD software, as suggested by ric in message #4.
     
        Mysil


    Thanks. Yes, I figured that out last night. I am still struggling to bring this library into a project compatible with the PIC I am currently using, 16F18326.
    I'm working on it...
    #9
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/21 01:10:56 (permalink)
    0
    So, I am rather stumped. I downloaded the file from this link: LCD_LIB_TEST_20190920.zip
    as that one seemed the more current of the two.
     
    Seeing as I am using a pic chip not supported by this project, I started a new project for PIC16F18326 in mplab x ide and using mcc generated the header and source files and main.c
     
    I added these to my project:
                 "LCD_lib_busy.c"
                 "LCD_lib_busy.h"
                 "lcd_lib_test.h"
     
    I added these includes to my "mcc.h":
                     #include "LCD_lib_busy.h"
                     #include "LCD_lib_test.h"
     
     
    Rather than include "lcd_config.h" file, I added the relevant pin definitions to my "device_config.h" and set them to correspond with how I have my breadboard laid out.
     
    Here is my "device_config.h":

     
    #ifndef DEVICE_CONFIG_H
    #define DEVICE_CONFIG_H
    #define _XTAL_FREQ 4000000
     
    #define LCD_DELAY_5MS() __delay_ms(5)
    #define LCD_DELAY_1US() __delay_us(1)

    #define LCD_TIMEOUT 100 // max nr. of busy checks ...
     
    #define LCD_E LATAbits.LATA2
    #define LCD_E_DIR TRISAbits.TRISA2
    #define LCD_RW LATAbits.LATA4
    #define LCD_RW_DIR TRISAbits.TRISA4
    #define LCD_RS LATAbits.LATA5
    #define LCD_RS_DIR TRISAbits.TRISA5
    #define LCD_D4_IN PORTCbits.RC2
    #define LCD_D5_IN PORTCbits.RC3
    #define LCD_D6_IN PORTCbits.RC4
    #define LCD_D7_IN PORTCbits.RC5
    #define LCD_D4_OUT LATCbits.LATC2
    #define LCD_D5_OUT LATCbits.LATC3
    #define LCD_D6_OUT LATCbits.LATC4
    #define LCD_D7_OUT LATCbits.LATC5
    #define LCD_D4_DIR TRISCbits.TRISC2
    #define LCD_D5_DIR TRISCbits.TRISC3
    #define LCD_D6_DIR TRISCbits.TRISC4
    #define LCD_D7_DIR TRISCbits.TRISC5
    #define LCD_DIR_IN() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 1
    #define LCD_DIR_OUT() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 0

    #define LCD_PINS_DIGITAL() ANSELC &= 0b11000011
    #endif /* DEVICE_CONFIG_H */
    /**
    End of File
    */
     

     
    Unfortunately, the project will not build.
    If I remove "LCD_lib_busy.c" from the project, it builds. 
    What am I doing wrong?
     
    #10
    vloki
    Jo, alla!
    • Total Posts : 6811
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: LCD Library 2019/11/21 05:30:06 (permalink)
    0
    There is an error message like: ..../LCD_lib_busy.h:60:10: fatal error: 'lcd_config.h' file not found ?
    LCD_lib_busy. c includes LCD_lib_busy.h which includes lcd_config.h
    All 3 files a part of the library. The config file is the one that depends on your hardware and so it is specific for the project.
     
    Of course you have different possibilities to fix your problem.
    The main issue may be that you have to know what you are doing.
    MCC possibly is not very helpful in that aspect
    post edited by vloki - 2019/11/21 05:46:07

    Uffbasse !
    #11
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/21 22:39:41 (permalink)
    0
    I neglected to mention in my previous post, that I had also edited LCD_lib_busy.h to include device_config.h instead of lcd_config.h, as I had removed that from my project. 
     
    Here's the error I get:
     

     
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    2 warnings and 20 errors generated.
    (908) exit status = 1
    nbproject/Makefile-default.mk:121: recipe for target 'build/default/debug/mcc_generated_files/LCD_lib_busy.p1' failed
    make[2]: Leaving directory '/Users/didierleplae/LCD_TEST_RIC4.X'
    nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
    make[1]: Leaving directory '/Users/didierleplae/LCD_TEST_RIC4.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
     
    BUILD FAILED (exit value 2, total time: 334ms)
     

    #12
    vloki
    Jo, alla!
    • Total Posts : 6811
    • Reward points : 0
    • Joined: 2007/10/15 00:51:49
    • Location: Germany
    • Status: offline
    Re: LCD Library 2019/11/21 23:57:24 (permalink)
    0
    didierleplaeHere's the error I get:

    Try to post it again...

    Uffbasse !
    #13
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/22 00:27:24 (permalink)
    0
    vloki
    didierleplaeHere's the error I get:

    Try to post it again...


    Sorry, I'm confused, post what again?
    #14
    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LCD Library 2019/11/22 00:40:58 (permalink)
    +2 (2)
    The actual error.
    It's not in the bit you posted, it would have been in the bit you left out.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #15
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/22 21:59:42 (permalink)
    0
    Ah ok, sorry about that. Here's the whole thing:
     

    make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
    make[1]: Entering directory '/Users/didierleplae/LCD_TEST_RIC4.X'
    make -f nbproject/Makefile-default.mk dist/default/debug/LCD_TEST_RIC4.X.debug.elf
    make[2]: Entering directory '/Users/didierleplae/LCD_TEST_RIC4.X'
    "/Applications/microchip/xc8/v2.05/bin/xc8-cc" -mcpu=16F18326 -c -D__DEBUG=1 -fno-short-double -fno-short-float -O0 -fasmfile -maddrqual=ignore -xassembler-with-cpp -Wa,-a -DXPRJ_default=default -msummary=-psect,-class,+mem,-hex,-file -ginhx032 -Wl,--data-init -mno-keep-startup -mno-osccal -mno-resetbits -mno-save-resetbits -mno-download -mno-stackcall -std=c99 -gdwarf-3 -mstack=compiled:auto:auto -o build/default/debug/mcc_generated_files/LCD_lib_busy.p1 mcc_generated_files/LCD_lib_busy.c
    mcc_generated_files/LCD_lib_busy.c:20:2: warning: "##### Ensure LCD-Delays are defined properly in lcd_config.h! #####" [-W#warnings]
    #warning "##### Ensure LCD-Delays are defined properly in lcd_config.h! #####"
    ^
    1 warning generated.
    mcc_generated_files/LCD_lib_busy.c:20:2: warning: "##### Ensure LCD-Delays are defined properly in lcd_config.h! #####" [-W#warnings]
    #warning "##### Ensure LCD-Delays are defined properly in lcd_config.h! #####"
    ^
    make[2]: *** [build/default/debug/mcc_generated_files/LCD_lib_busy.p1] Error 1
    make[1]: *** [.build-conf] Error 2
    make: *** [.build-impl] Error 2
    mcc_generated_files/LCD_lib_busy.c:42:5: error: use of undeclared identifier 'LATAbits'
    LCD_RW = 0; LCD_RW_DIR = 0;
    ^
    mcc_generated_files/device_config.h:64:21: note: expanded from macro 'LCD_RW'
    #define LCD_RW LATAbits.LATA4
    ^
    mcc_generated_files/LCD_lib_busy.c:42:17: error: use of undeclared identifier 'TRISAbits'
    LCD_RW = 0; LCD_RW_DIR = 0;
    ^
    mcc_generated_files/device_config.h:65:21: note: expanded from macro 'LCD_RW_DIR'
    #define LCD_RW_DIR TRISAbits.TRISA4
    ^
    mcc_generated_files/LCD_lib_busy.c:43:5: error: use of undeclared identifier 'LATAbits'
    LCD_RS = 0; LCD_RS_DIR = 0;
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:43:17: error: use of undeclared identifier 'TRISAbits'
    LCD_RS = 0; LCD_RS_DIR = 0;
    ^
    mcc_generated_files/device_config.h:67:21: note: expanded from macro 'LCD_RS_DIR'
    #define LCD_RS_DIR TRISAbits.TRISA5
    ^
    mcc_generated_files/LCD_lib_busy.c:44:5: error: use of undeclared identifier 'LATAbits'
    LCD_E = 0; LCD_E_DIR = 0;
    ^
    mcc_generated_files/device_config.h:62:21: note: expanded from macro 'LCD_E'
    #define LCD_E LATAbits.LATA2
    ^
    mcc_generated_files/LCD_lib_busy.c:44:17: error: use of undeclared identifier 'TRISAbits'
    LCD_E = 0; LCD_E_DIR = 0;
    ^
    mcc_generated_files/device_config.h:63:21: note: expanded from macro 'LCD_E_DIR'
    #define LCD_E_DIR TRISAbits.TRISA2
    ^
    mcc_generated_files/LCD_lib_busy.c:51:5: error: use of undeclared identifier 'ANSELC'
    LCD_PINS_DIGITAL();
    ^
    mcc_generated_files/device_config.h:86:29: note: expanded from macro 'LCD_PINS_DIGITAL'
    #define LCD_PINS_DIGITAL() ANSELC &= 0b11000011
    ^
    mcc_generated_files/LCD_lib_busy.c:54:5: error: use of undeclared identifier 'TRISCbits'
    LCD_DIR_OUT();
    ^
    mcc_generated_files/device_config.h:83:23: note: expanded from macro 'LCD_DIR_OUT'
    #define LCD_DIR_OUT() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 0
    ^
    mcc_generated_files/device_config.h:77:21: note: expanded from macro 'LCD_D4_DIR'
    #define LCD_D4_DIR TRISCbits.TRISC2
    ^
    mcc_generated_files/LCD_lib_busy.c:54:5: error: use of undeclared identifier 'TRISCbits'
    mcc_generated_files/device_config.h:83:62: note: expanded from macro 'LCD_DIR_OUT'
    #define LCD_DIR_OUT() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 0
    ^
    mcc_generated_files/device_config.h:80:21: note: expanded from macro 'LCD_D7_DIR'
    #define LCD_D7_DIR TRISCbits.TRISC5
    ^
    mcc_generated_files/LCD_lib_busy.c:54:5: error: use of undeclared identifier 'TRISCbits'
    mcc_generated_files/device_config.h:83:49: note: expanded from macro 'LCD_DIR_OUT'
    #define LCD_DIR_OUT() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 0
    ^
    mcc_generated_files/device_config.h:79:21: note: expanded from macro 'LCD_D6_DIR'
    #define LCD_D6_DIR TRISCbits.TRISC4
    ^
    mcc_generated_files/LCD_lib_busy.c:54:5: error: use of undeclared identifier 'TRISCbits'
    mcc_generated_files/device_config.h:83:36: note: expanded from macro 'LCD_DIR_OUT'
    #define LCD_DIR_OUT() LCD_D4_DIR = LCD_D5_DIR = LCD_D6_DIR = LCD_D7_DIR = 0
    ^
    mcc_generated_files/device_config.h:78:21: note: expanded from macro 'LCD_D5_DIR'
    #define LCD_D5_DIR TRISCbits.TRISC3
    ^
    mcc_generated_files/LCD_lib_busy.c:58:5: warning: implicit declaration of function '__delay_ms' is invalid in C99 [-Wimplicit-function-declaration]
    LCD_DELAY_5MS();LCD_DELAY_5MS();LCD_DELAY_5MS(); // wait for 15ms
    ^
    mcc_generated_files/device_config.h:54:25: note: expanded from macro 'LCD_DELAY_5MS'
    #define LCD_DELAY_5MS() __delay_ms(5)
    ^
    mcc_generated_files/LCD_lib_busy.c:96:9: error: use of undeclared identifier 'LATAbits'
    LCD_Command(FOUR_BIT_TWO_LINE);
    ^
    mcc_generated_files/LCD_lib_busy.h:98:45: note: expanded from macro 'LCD_Command'
    #define LCD_Command while(LCD_Busy()){;} LCD_RS = LCD_CMD; LCD_Write
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:99:5: error: use of undeclared identifier 'LATAbits'
    LCD_Command(DISPLAY_CTRL + DISPLAY_ON);// + BLINK_ON);
    ^
    mcc_generated_files/LCD_lib_busy.h:98:45: note: expanded from macro 'LCD_Command'
    #define LCD_Command while(LCD_Busy()){;} LCD_RS = LCD_CMD; LCD_Write
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:100:5: error: use of undeclared identifier 'LATAbits'
    LCD_Command(ENTRY_MODE + CURSOR_INC + DSHIFT_OFF);
    ^
    mcc_generated_files/LCD_lib_busy.h:98:45: note: expanded from macro 'LCD_Command'
    #define LCD_Command while(LCD_Busy()){;} LCD_RS = LCD_CMD; LCD_Write
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:101:5: error: use of undeclared identifier 'LATAbits'
    LCD_Clear();
    ^
    mcc_generated_files/LCD_lib_busy.h:94:21: note: expanded from macro 'LCD_Clear'
    #define LCD_Clear() LCD_Command(CLEAR_DISPLAY); LCD_DELAY_5MS()
    ^
    mcc_generated_files/LCD_lib_busy.h:98:45: note: expanded from macro 'LCD_Command'
    #define LCD_Command while(LCD_Busy()){;} LCD_RS = LCD_CMD; LCD_Write
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:102:5: error: use of undeclared identifier 'LATAbits'
    LCD_Home();
    ^
    mcc_generated_files/LCD_lib_busy.h:95:21: note: expanded from macro 'LCD_Home'
    #define LCD_Home() LCD_Command(RETURN_HOME); LCD_DELAY_5MS()
    ^
    mcc_generated_files/LCD_lib_busy.h:98:45: note: expanded from macro 'LCD_Command'
    #define LCD_Command while(LCD_Busy()){;} LCD_RS = LCD_CMD; LCD_Write
    ^
    mcc_generated_files/device_config.h:66:21: note: expanded from macro 'LCD_RS'
    #define LCD_RS LATAbits.LATA5
    ^
    mcc_generated_files/LCD_lib_busy.c:108:5: error: use of undeclared identifier 'TRISAbits'
    LCD_RS_DIR = 0;
    ^
    mcc_generated_files/device_config.h:67:21: note: expanded from macro 'LCD_RS_DIR'
    #define LCD_RS_DIR TRISAbits.TRISA5
    ^
    mcc_generated_files/LCD_lib_busy.c:109:5: error: use of undeclared identifier 'TRISAbits'
    LCD_RW_DIR = 0;
    ^
    mcc_generated_files/device_config.h:65:21: note: expanded from macro 'LCD_RW_DIR'
    #define LCD_RW_DIR TRISAbits.TRISA4
    ^
    mcc_generated_files/LCD_lib_busy.c:110:5: error: use of undeclared identifier 'TRISAbits'
    LCD_E_DIR = 0;
    ^
    mcc_generated_files/device_config.h:63:21: note: expanded from macro 'LCD_E_DIR'
    #define LCD_E_DIR TRISAbits.TRISA2
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    2 warnings and 20 errors generated.
    (908) exit status = 1
    nbproject/Makefile-default.mk:121: recipe for target 'build/default/debug/mcc_generated_files/LCD_lib_busy.p1' failed
    make[2]: Leaving directory '/Users/didierleplae/LCD_TEST_RIC4.X'
    nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
    make[1]: Leaving directory '/Users/didierleplae/Desktop/Volt-A-Tone/PIC_Files/LCD_TEST_RIC4.X'
    nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
    BUILD FAILED (exit value 2, total time: 431ms)

    #16
    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LCD Library 2019/11/22 22:03:46 (permalink)
    0
    Always start from the first error reported.
    In this case, it is:
    mcc_generated_files/LCD_lib_busy.c:42:5: error: use of undeclared identifier 'LATAbits'
     LCD_RW = 0; LCD_RW_DIR = 0;

    How have you defined "LCD_RW" ?
    It appears you have defined it as just LATAbits without a bitfield suffix.
     
    If it is in fact as you posted above
    #define LCD_RW LATAbits.LATA4

    then my next guess is that you have not included <xc.h> before you included this header file.
    xc.h should always be the first #include.
     
     
     
    post edited by ric - 2019/11/22 22:06:18

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #17
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/22 22:05:32 (permalink)
    0
    Oh wow, I think I may have stumbled on the answer. I put #include <xc.h> in the LCD_lib_busy.c  and now it builds
     
    #18
    ric
    Super Member
    • Total Posts : 24638
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: offline
    Re: LCD Library 2019/11/22 22:07:17 (permalink)
    0
    I was editing my post as you posted.
    You don't need it in every .h file.
    It should appear once in each C file that includes this header file, BEFORE all the other includes.
    I avoid ever including header files into other header files.
     
    Edit: oops, I see you were talking about your C file, not your H file.
    Yes, EVERY C file should #include xc.h
     
    post edited by ric - 2019/11/22 22:09:29

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #19
    didierleplae
    Junior Member
    • Total Posts : 101
    • Reward points : 0
    • Joined: 2019/03/31 16:57:50
    • Location: 0
    • Status: offline
    Re: LCD Library 2019/11/22 22:08:21 (permalink)
    0
    ric
     
    then my next guess is that you have not included <xc.h> before you included this header file.
    xc.h should always be the first #include.
     

     
    Ha, I think that's exactly right!
    #20
    Page: 123 > Showing page 1 of 3
    Jump to:
    © 2019 APG vNext Commercial Version 4.5