Ok, Let me run through this.
Here is my code (trimmed a bit of the unrelated stuff out)
#include <stdio.h>
#include <stdlib.h>
#include "p24FV32KA302.h"
#include <libpic30.h>
#include <xc.h>
#include <xlcd.h>
// EDITED OUT FUSE BITS
void DelayFor18TCY( void ) { __delay_ms(100); return;};
void DelayPORXLCD ( void ) { __delay_ms(100); return;}; //Can Be 15ms
void DelayXLCD ( void ) { __delay_ms(100); return;}; //Can Be 5ms
int main(int argc, char** argv) {
TRISA=0x00;
TRISB=0x00;
OpenXLCD( FOUR_BIT & LINES_5X7);
while(1){};
return (EXIT_SUCCESS);
}
I then get an error where I have included xlcd.h
File C:\PICS\PIC24FVKA302TEST.X\xlcd.h From project PIC24FVKA302TEST but there is an unresolved #include "p18cxxx.h" in included C:\PICS\PIC24FVKA302TEST.X\xlcd.h
I then go into xlcd.h and comment out the include of the p18c file :
//#include "p18cxxx.h"
Then I try to compile, and get the following errors :
In file included from C:/PICS/PIC24FVKA302TEST.X/MAIN.c:15:0:
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:76:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:81:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:86:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:106:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:111:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:121:1: error: storage class specified for unnamed parameter
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:126:22: warning: type defaults to 'int' in declaration of 'rom'
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:126:26: error: expected ';', ',' or ')' before 'char'
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:66:0: warning: "DATA_PORT" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:34:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:67:0: warning: "TRIS_DATA_PORT" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:35:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:72:0: warning: "RW_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:40:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:73:0: warning: "TRIS_RW" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:41:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:75:0: warning: "RS_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:43:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:76:0: warning: "TRIS_RS" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:44:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:78:0: warning: "E_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:46:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:79:0: warning: "TRIS_E" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:47:0: note: this is the location of the previous definition
nbproject/Makefile-default.mk:164: recipe for target 'build/default/production/_ext/726147975/MAIN.o' failed
which seems to be prototypes (if I look into xlcd.h)
76 void OpenXLCD(PARAM_SCLASS unsigned char);
81 void SetCGRamAddr(PARAM_SCLASS unsigned char);
but I see PARAM_SCLASS is defined in line 70
#define PARAM_SCLASS auto
So I tried removing PARAM_SCLASS from all those lines eg :
76 void OpenXLCD(unsigned char);
81 void SetCGRamAddr(unsigned char);
Then I try to compile, and get :
"C:\Program Files\Microchip\xc16\v1.23\bin\xc16-gcc.exe" C:/PICS/PIC24FVKA302TEST.X/MAIN.c -o build/default/production/_ext/726147975/MAIN.o -c -mcpu=24FV32KA302 -MMD -MF "build/default/production/_ext/726147975/MAIN.o.d" -g -omf=elf -I"C:/PICS/PIC24FVKA302TEST.X" -I"C:/PICS/PIC24FVKA302TEST.X/xlcd" -O0 -msmart-io=1 -Wall -msfr-warn=off
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:66:0: warning: "DATA_PORT" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:34:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:67:0: warning: "TRIS_DATA_PORT" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:35:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:72:0: warning: "RW_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:40:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:73:0: warning: "TRIS_RW" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:41:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:75:0: warning: "RS_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:43:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:76:0: warning: "TRIS_RS" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:44:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:78:0: warning: "E_PIN" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:46:0: note: this is the location of the previous definition
C:/PICS/PIC24FVKA302TEST.X/MAIN.c:79:0: warning: "TRIS_E" redefined
C:/PICS/PIC24FVKA302TEST.X/xlcd.h:47:0: note: this is the location of the previous definition
"C:\Program Files\Microchip\xc16\v1.23\bin\xc16-gcc.exe" C:/PICS/PIC24FVKA302TEST.X/openxlcd.c -o build/default/production/_ext/726147975/openxlcd.o -c -mcpu=24FV32KA302 -MMD -MF "build/default/production/_ext/726147975/openxlcd.o.d" -g -omf=elf -I"C:/PICS/PIC24FVKA302TEST.X" -I"C:/PICS/PIC24FVKA302TEST.X/xlcd" -O0 -msmart-io=1 -Wall -msfr-warn=off
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:1:21: fatal error: p18cxxx.h: No such file or directory
So I go into openxlcd.c and busyxlcd.c and comment out the include for the p18c files, as well as the include for delays.h that is in openxlcd.c, and try to recompile
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c: In function 'OpenXLCD':
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:28:9: error: 'PORTB' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:28:9: note: each undeclared identifier is reported only once for each function it appears in
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:29:9: error: 'TRISB' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:35:9: error: 'TRISAbits' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:36:9: error: 'TRISBbits' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:38:9: error: 'LATAbits' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:39:9: error: 'LATBbits' undeclared (first use in this function)
C:/PICS/PIC24FVKA302TEST.X/openxlcd.c:46:4: warning: implicit declaration of function 'Delay10KTCYx'
make[2]: *** [build/default/production/_ext/726147975/openxlcd.o] Error 255
I did not have any of these problems when using XLCD.h on the 8 bit micros with C18 compiler....