View previous topic :: View next topic |
Author |
Message |
pop
Joined: 18 Sep 2004 Posts: 22
|
MPLAB 6.40 and CCS Again! |
Posted: Fri Jan 07, 2005 12:49 pm |
|
|
Hi,
I previously asked you guys how do I run CCS compiler on MPLAB 6.4. It turned out that apparently my compiler version was too old. (3.112)
Right now I' m at the lab where we have a newer version of compiler (3.202).
I've just installed mplab 6.4, then Mplab 6.XX plugin, I've selected 16F877 in the configuration of device and tried to compile one of my programs from home which I had previously compiled with version 3.112.
The following error occured:
Quote: | Deleting intermediary files... done.
Executing: "C:\PICC\Ccsc.exe" "testThrm6_40.c" +FM +DF +LN +T -A +M -Z +Y=9 +EA
*** Error 23 "E:\PIC Projects\MPLAB6_40 Projects\testTherm6_40\testThrm6_40.c" Line 91(9,50): Can not change device type this far into the code
*** Error 23 "E:\PIC Projects\MPLAB6_40 Projects\testTherm6_40\testThrm6_40.c" Line 91(9,50): Can not change device type this far into the code
2 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Fri Jan 07 15:05:02 2005
|
Now in MPLAB the error cursor points at the following device setup line which I have in my code:
#include <16f877.h>
#fuses HS,NOWDT,NOPROTECT
#device PIC 16F877 ADC=10 /* Use the 10 bits */
#use delay(clock=20000000)
#use rs232(BAUD=9600,XMIT=PIN_C6,RCV=PIN_C7)
#opt 9
How can I fix this problem while maintaining interchangibility of code between my MPLAB and CCS version at home (5.7 and 3.112 respectively) and those at the lab?
Also "+FM +DF +LN +T -A +M -Z +Y=9 +EA" are these options to blame considering I only use "+FM" with my home version 3.112?
I would appreciate any help given on this matter, as MPLAB 6.4 is leaving me frustrated time and time again! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Jan 07, 2005 12:53 pm |
|
|
The 16F877.H file contains a "#device PIC16F877" line right near
the start of the file. You don't need two of them.
Change this line,
#device PIC 16F877 ADC=10 /* Use the 10 bits */
to this:
#device ADC=10 // Use the 10 bits |
|
|
pop
Joined: 18 Sep 2004 Posts: 22
|
|
Posted: Fri Jan 07, 2005 1:52 pm |
|
|
Finally it compiled!
Thank you very much PCM programmer! |
|
|
|