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 on MPLAB compiling

Status
Not open for further replies.

ZonGzAi

Newbie level 3
Newbie level 3
Joined
Jul 20, 2014
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
32
i'm newbie for MPLAB X...now i facing the problem and donno how to solve it...
below is my programming header files.
Code:
"#include <as16F877.h>
#include<pic.h>
#ifndef _AS16F877_H_
#define _AS16F877_H_
#include <xc.inc>
#endif // _AS16F877_H_"

any dear friend can help me???thank you very much...

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
make -f nbproject/Makefile-default.mk dist/default/production/LCD_DISPLAY.X.production.hex
make[2]: Entering directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
"C:\Program Files (x86)\Microchip\xc8\v1.31\bin\xc8.exe" --pass1 --chip=16F877 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%%f:%%l: error: (%%n) %%s" "--warnformat=%%f:%%l: warning: (%%n) %%s" "--msgformat=%%f:%%l: advisory: (%%n) %%s" -obuild/default/production/main.p1 main.c
(908) exit status = 1
make[2]: *** [build/default/production/main.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:44: warning: (374) missing basic type; int assumed
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:44: error: (372) "," expected
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:44: error: (314) ";" expected
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:74: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:89: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:136: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:170: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:190: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:214: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:234: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:237: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:258: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:278: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:281: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:309: error: (222) binary digit expected
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:330: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:350: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:384: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:404: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:418: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:426: error: (220) exponent expected
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:453: error: (223) digit out of range
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:453: advisory: (1) too many errors (21)
make[2]: Leaving directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
make[1]: Leaving directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'

BUILD FAILED (exit value 2, total time: 363ms)
 
Last edited by a moderator:

xc.inc is usually xc.h and you don't normally have to include the processor header as well.

Without knowing what is inside 'as16F877.h' it's impossible to see if it contains any errors. In the message:
C:\Program Files (x86)\Microchip\xc8\v1.31\include\pic16f877.inc:13 6: error: (223) digit out of range
the (223) is the line number containing the error, please look at that line and let us know what it contains. Incidentally, the quote marks around the header should not be there.

Brian.
 

Hi Brian.Thanks for your reply.I had change the programming as u say xc.inc to xc.h, and i also cancel the include the processor as shown below


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#include<pic.h>
#include <xc.h>
#include<htc.h>
#define RS RE0
#define RW RE1
#define EN RE2
#define DATA PORTB
 
void LCD_CMD(unsigned int value);
void LCD_DAT(unsigned int value);
void delay();
 
 
int main(void)
{
    ADCON0 = 0x00;//Disable ADC ports
    ADCON1 = 0x06;//Disable ADC ports
 
    TRISE =0x00;
    TRISB =0x00;
    //DATA=0x01;
    LCD_CMD(0x01);
    delay ();
    LCD_CMD(0x38);
    delay ();
    LCD_CMD(0x0F);
    delay ();
   // LCD_CMD(0x07);
    delay();
    LCD_CMD(0x06);
    delay ();
    LCD_CMD(0x0c);
    delay ();
 
 
    LCD_CMD(0x80);
    delay ();
 
    //DATA='A';
    LCD_DAT('S');
    LCD_DAT('E');
    LCD_DAT('R');
    LCD_DAT('V');
    LCD_DAT('4');
    LCD_DAT('U');
 
    LCD_CMD(0x80);
     while(1);
    return (0);
 
}
 
void LCD_CMD(unsigned int value)
{
    DATA =value;
    RS=0;
    RW=0;
    EN=1;
    delay ();
    EN=0;
    delay ();
 }
 
void LCD_DAT(unsigned int value)
{
    DATA=value;
    RS=1;
    RW=0;
    EN=1;
    delay ();
    EN=0;
    delay();
 
}
 
void delay(void)
{
    int counter = 0;
    for (counter = 0; counter<10000; counter++) {
        ;
    }
}



and after build, the report is

make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
make -f nbproject/Makefile-default.mk dist/default/production/LCD_DISPLAY.X.production.hex
make[2]: Entering directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
"C:\Program Files (x86)\Microchip\xc8\v1.31\bin\xc8.exe" --pass1 --chip=16F877 -Q -G --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%%f:%%l: error: (%%n) %%s" "--warnformat=%%f:%%l: warning: (%%n) %%s" "--msgformat=%%f:%%l: advisory: (%%n) %%s" -obuild/default/production/main.p1 main.c
"C:\Program Files (x86)\Microchip\xc8\v1.31\bin\xc8.exe" --chip=16F877 -G -mdist/default/production/LCD_DISPLAY.X.production.map --double=24 --float=24 --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,+osccal,-resetbits,-download,-stackcall,+clib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto "--errformat=%%f:%%l: error: %%s" "--warnformat=%%f:%%l: warning: (%%n) %%s" "--msgformat=%%f:%%l: advisory: (%%n) %%s" -odist/default/production/LCD_DISPLAY.X.production.elf build/default/production/main.p1
Microchip MPLAB XC8 C Compiler (Free Mode) V1.31
Part Support Version: 1.32 (A)
Copyright (C) 2014 Microchip Technology Inc.
License type: Node Configuration

:: warning: (1273) Omniscient Code Generation not available in Free mode

Memory Summary:
Program space used E5h ( 229) of 2000h words ( 2.8%)
Data space used 6h ( 6) of 170h bytes ( 1.6%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Data stack space used 0h ( 0) of 60h bytes ( 0.0%)
Configuration bits used 0h ( 0) of 1h word ( 0.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)


Running this compiler in PRO mode, with Omniscient Code Generation enabled,
produces code which is typically 40% smaller than in Free mode.
See https://microchip.com for more information.

make[2]: Leaving directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'
make[1]: Leaving directory `C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X'

BUILD SUCCESSFUL (total time: 1s)
Loading code from C:/Users/EngZong/MPLABXProjects/LCD_DISPLAY.X/dist/default/production/LCD_DISPLAY.X.production.hex...
Loading completed

But my LCD cant display any word.The source code was download online and the developer mention that the source code can function.

Sorry for my broken English.^_^
 
Last edited by a moderator:

Agreed, htc.h is for a different compiler altogether and may have conflicting definitions. I'm not sure what is in pic.h but it probably isn't needed either.

:: warning: (1273) Omniscient Code Generation not available in Free mode

is just Microchip's way of trying to persuade you to upgrade to their pro version, you can ignore it unless you need coptimized code and are rich!

I suspect your problem is with the delay routine. Each command needs different delays and you also need a long delay at the start for the LCD to initialize it's own processor before you can wrie anything to it at all. I think later versions of XC8 have delay routines built in so it would be worth checking them and using the values recommended in the LCD data sheet.

Brian.
 

Hi dear friends. Sorry for late reply.This few days i was out station, thank you for your information, i will try again in this weekend. Thank you very much ^_^
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top