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

MPLAB 6.40 and CCS Again!

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



Joined: 18 Sep 2004
Posts: 22

View user's profile Send private message

MPLAB 6.40 and CCS Again!
PostPosted: Fri Jan 07, 2005 12:49 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 07, 2005 12:53 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Jan 07, 2005 1:52 pm     Reply with quote

Finally it compiled!

Thank you very much PCM programmer!
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