CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Pic16f886

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Gerhard
Guest







Pic16f886
PostPosted: Thu Aug 30, 2007 4:12 pm     Reply with quote

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







PostPosted: Thu Aug 30, 2007 4:32 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 30, 2007 4:39 pm     Reply with quote

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







PostPosted: Thu Aug 30, 2007 4:43 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 30, 2007 4:58 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 30, 2007 5:00 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 30, 2007 5:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 30, 2007 5:07 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 30, 2007 5:14 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 30, 2007 5:17 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Aug 30, 2007 5:25 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Thu Aug 30, 2007 5:33 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group