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

CCS compiler "target chip" stuck set to PIC16F877A

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



Joined: 12 Jul 2014
Posts: 4

View user's profile Send private message

CCS compiler "target chip" stuck set to PIC16F877A
PostPosted: Sat Jul 12, 2014 9:40 pm     Reply with quote

Hello,

First of all thanks to everyone who takes the time to read my post. Total n00b here trying to learn the ropes but I'm having trouble right off the bat.

I have a PIC16F887 microcontroller and an ICD-U64 unit. I'm trying to implement my first (very basic) program out of the manual using the PCW compiler software. I've pasted my program below - unfortunately I get an error at line 3 saying a #DEVICE required before this line.

If I click on "Lookup Part" to "Select target chip" I realize that the wrong chip is specified (PIC16F877A instead of PIC16F887 which is what I want). The program won't let me select another option. If I do, once I hit OK and go back to "Lookup Part" it reverts back to PIC16F877A. It won't save my change to the target chip. Under options < project options < files I have correctly specified the target as PIC16F887.

Can someone help me out? Is my error message related to the wrong target chip problem? I don't know why the program won't let me properly specify my target device. Can't figure it out!! Thanks for any guidance.

Code:
#include <16F887.h>
#device ICD=TRUE
#fuse HS,NOLVP,NOWDT
#delay (clock=20000000)

#define GREEN_LED PIN_A5

void main () {
   while (TRUE) {
      output_low (GREEN_LED);
      delay_ms (1000);
      output_high (GREEN_LED);
      delay_ms (1000);
   }
}
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Jul 12, 2014 9:51 pm     Reply with quote

what version compiler are you using?
_________________
Google and Forum Search are some of your best tools!!!!
newtoccs



Joined: 12 Jul 2014
Posts: 4

View user's profile Send private message

PostPosted: Sat Jul 12, 2014 9:54 pm     Reply with quote

Version 4.112

I got it a few years ago but am only just getting it out of the box. Unfortunately I don't think I'm eligible to update the program
newtoccs



Joined: 12 Jul 2014
Posts: 4

View user's profile Send private message

PostPosted: Sat Jul 12, 2014 9:56 pm     Reply with quote

And I'm not sure if it's relevant but now when I try to run CCSLOAD I get a message saying "FIRMWARE OUT OF DATE" with no options to update it...
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 13, 2014 12:10 am     Reply with quote

Is it possible that you have the single-chip Student version of the compiler ?
http://www.ccsinfo.com/product_info.php?products_id=schip-edu

Or maybe a demo version ? Does the version number have a 'D'
at the end ? vs. 4.112d ?
newtoccs



Joined: 12 Jul 2014
Posts: 4

View user's profile Send private message

PostPosted: Sun Jul 13, 2014 9:00 am     Reply with quote

Checked for the d and there isn't one - so no demo version. And I definitely have the PIC16F887.

So the way I worked around it was that I started using the PIC wizard under the project programs to write the top of my code. I guess somehow this is writing over what is specified in the "Select Target Chip" dialog under "Lookup Part" and it worked.

Still wish I could figure out why this "Select Target Chip" dialog won't change though.
Ttelmah



Joined: 11 Mar 2010
Posts: 19538

View user's profile Send private message

PostPosted: Mon Jul 14, 2014 12:44 am     Reply with quote

I must admit I've never attempted to change the target chip.

The compiler sets this, when it sees a program using a particular chip.

If you read the manual, you are not meant to change this.

It says:

"
It is very important to note that changing the pulldown does not actually change the target processor used for compiling. For example, changing the pull-down from a PIC16F877A to a PIC16F887 will not actually change the build process to use a PIC16F887. In order to change the build process for this new processor, the actual C code needs to be changed by finding the #device line in code and changing it to the new processor. These #devices are found in the header file for this device, so for most people changing the #include <16f877a.h> to #include <16f887.h> will change the build process as desired.
"
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