View previous topic :: View next topic |
Author |
Message |
Gerhard Guest
|
Pic16f886 |
Posted: Thu Aug 30, 2007 4:12 pm |
|
|
Hi.
Can any body please help me. I just started working on Microchips for a university subject. I seem to have problems with the header file of the 16f886. When I try just to test building it, there's an error report saying build failure. It points to the header file at line 2.
Any help would be apreciated.
Thanks |
|
|
Gerhard Guest
|
|
Posted: Thu Aug 30, 2007 4:32 pm |
|
|
Here is a bit more info.
I am workong in MP Lab v7.4 and PCWH v3.227.
The header file i used was not available so i downloaded it. The error report is as follows:
Clean: Deleting intermediary and output files.
Clean: Deleted file "main.$$$".
Clean: Deleted file "main.ERR".
Clean Warning: File "C:\Mplabtoets\main.o" doesn't exist.
Clean: Deleted file "C:\Mplabtoets\toets1.mcs".
Clean: Done.
Executing: "C:\Program files\Picc\CCSC.exe" "main.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 7 "C:\Mplabtoets\16f886.h" Line 3(10,14): Invalid Pre-Processor directive
*** Error 128 "C:\Mplabtoets\16f886.h" Line 3(15,16): A #DEVICE required before this line
*** "C:\Mplabtoets\16f886.h" Line 3: Error #48: Expecting a (
*** "C:\Mplabtoets\16f886.h" Line 3: Error #48: Expecting a (
*** "C:\Mplabtoets\16f886.h" Line 3: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 3: Error #48: Expecting a (
*** "C:\Mplabtoets\16f886.h" Line 3: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 3: Error #48: Expecting a (
*** "C:\Mplabtoets\16f886.h" Line 3: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 3: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 17: Error #7: Invalid Pre-Processor directive
*** "C:\Mplabtoets\16f886.h" Line 17: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 17: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 17: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 18: Error #7: Invalid Pre-Processor directive
*** "C:\Mplabtoets\16f886.h" Line 18: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 18: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 18: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 19: Error #7: Invalid Pre-Processor directive
*** "C:\Mplabtoets\16f886.h" Line 19: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 19: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 19: Error #43: Expecting a declaration
*** "C:\Mplabtoets\16f886.h" Line 24: Error #7: Invalid Pre-Processor directive
*** "C:\Mplabtoets\16f886.h" Line 24: Error #48: Expecting a (
*** "C:\Mplabtoets\16f886.h" Line 26: Error #7: Invalid Pre-Processor directive
And so it goes on and on until it says build Failed. I just wrote a simple while(1) loop to check if build would suceed. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 30, 2007 4:39 pm |
|
|
Your version of the compiler doesn't support the 16F886.
Adding the header file (16F886.H) won't add support. There has to be
a record in the Devices.dat file for the 16F886. There also have to be
routines in the PCM.DLL file to support any peripherals that are different
(or new) from "standard" PIC peripherals. |
|
|
Gerhard Guest
|
|
Posted: Thu Aug 30, 2007 4:43 pm |
|
|
Thanks but im very new at this.
How or where do i get the new compiler and what is the main problem, is it the PCWH or the MPLAB. I know its something silly but i am only starting to use microchips now so i have got a lot to learn.
21 year old 3rd year engineering student |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 30, 2007 4:58 pm |
|
|
The compiler is the main problem. Vs. 3.227 doesn't support the 16F886.
Also, MPLAB vs. 7.41 says it doesn't support the 16F886 with the ICD2
programmer, but it did work for me.
---------
It would be easier to buy a PIC that is supported by your tools.
You could buy a 16F876. It's similar to the 16F886, and it is supported. |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Aug 30, 2007 5:00 pm |
|
|
I downloaded the new version 4 demo but now it needs a .crg file. It says mine is to old for the newer version. What does that mean?
Thanks for the help |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Aug 30, 2007 5:03 pm |
|
|
didnt see the last part of your reply.
Our specs for our 3rd year project says that we have to use the 16f886. I have got another pic kit but i am not alowed to use that one. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 30, 2007 5:07 pm |
|
|
The demo doesn't support the 16F886:
Quote: |
The demo is a limited PCWHD compiler for the Microchip PIC®mcu's:
14-bit PIC16F877, 14-bit PIC16C544, 16-bit PIC18F458
, and all 24-bit dsPIC30/dsPIC33/PIC24 DSCs. The demo compiler is
licensed for 30 days and has a 2k program size limit. |
|
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Aug 30, 2007 5:14 pm |
|
|
Thanks for your help.
I try using the 16f876 and see if the prof's will allow it. |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Aug 30, 2007 5:17 pm |
|
|
I tried building on that 16f876 but it also delivers the following error.
Clean: Deleting intermediary and output files.
Clean: Deleted file "main.$$$".
Clean: Deleted file "main.ERR".
Clean Warning: File "C:\Mplabtoets\main.o" doesn't exist.
Clean: Done.
Executing: "C:\Program files\Picc\CCSC.exe" "main.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
*** Error 24 "C:\PROGRA~1\PICC\devices\16f876.h" Line 2(9,18): Unknown device type
1 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Fri Aug 31 01:06:05 2007
Whats am i doing wrong?? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 30, 2007 5:25 pm |
|
|
You're probably erased your installation of vs. 3.227 when you installed
the CCS Demo (maybe). The demo doesn't support the 16F876. |
|
|
Gerhard
Joined: 30 Aug 2007 Posts: 144 Location: South Africa
|
|
Posted: Thu Aug 30, 2007 5:33 pm |
|
|
Clean: Deleting intermediary and output files.
Clean: Deleted file "C:\Mplabtoets\toets.mcs".
Clean: Done.
Executing: "C:\Program files\Picc\CCSC.exe" "main.c" +FM +DF +LN +T -A +M +Z +Y=9 +EA
>>> Warning 203 "C:\Mplabtoets\main.c" Line 6(1,1): Condition always TRUE
Memory usage: ROM=0% RAM=3% - 3%
0 Errors, 1 Warnings.
Loaded C:\Mplabtoets\main.cof.
BUILD SUCCEEDED: Fri Aug 31 01:24:08 2007
Thank you very much. Now i can start programming robot wars car. |
|
|
|