View previous topic :: View next topic |
Author |
Message |
newtoccs
Joined: 12 Jul 2014 Posts: 4
|
CCS compiler "target chip" stuck set to PIC16F877A |
Posted: Sat Jul 12, 2014 9:40 pm |
|
|
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
|
|
Posted: Sat Jul 12, 2014 9:51 pm |
|
|
what version compiler are you using? _________________ Google and Forum Search are some of your best tools!!!! |
|
|
newtoccs
Joined: 12 Jul 2014 Posts: 4
|
|
Posted: Sat Jul 12, 2014 9:54 pm |
|
|
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
|
|
Posted: Sat Jul 12, 2014 9:56 pm |
|
|
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
|
|
|
newtoccs
Joined: 12 Jul 2014 Posts: 4
|
|
Posted: Sun Jul 13, 2014 9:00 am |
|
|
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
|
|
Posted: Mon Jul 14, 2014 12:44 am |
|
|
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.
" |
|
|
|