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

new version of CCS

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







new version of CCS
PostPosted: Sat Aug 07, 2004 12:10 pm     Reply with quote

dear friends

hi everybody


I use CCS PCW with the version of 3.155 recently.

When I write the line

#device PIC16F877 *=16 ADC=10 ( even at the first line of my code)

I get an following error message :

"can't change device type this far into the code".

But, when I used older versions, there were no problem with this directive.

please help me.

poorly
dyeatman



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

View user's profile Send private message

Show us the first part of your code
PostPosted: Sat Aug 07, 2004 12:27 pm     Reply with quote

Post the first ten lines of your code with all your <include> statements (other than comments) so we can see what you have.
Ttelmah
Guest







Re: new version of CCS
PostPosted: Sun Aug 08, 2004 9:58 am     Reply with quote

poorly wrote:
dear friends

hi everybody


I use CCS PCW with the version of 3.155 recently.

When I write the line

#device PIC16F877 *=16 ADC=10 ( even at the first line of my code)

I get an following error message :

"can't change device type this far into the code".

But, when I used older versions, there were no problem with this directive.

please help me.

poorly

I seem to remember there was a problem about this version number, where the device with the chip type, _had_ to be seperated. There was a thread here at the time.
Personally, since you don't want two device statements with chip ID's, I'd use:
#include <16F877.h>
//This will define the device for you, and include the defintions
#device *=16 ADC=10
//This should setup the other configurations.

This way, you are setting the chip ID in one place only. If this doesn't work, I'd suspect it is just a compiler problem (it works fine on 3.156, and 3.148, which are the two versions I have 'bracketting' your version.

Best Wishes
poorly
Guest







new version
PostPosted: Tue Aug 10, 2004 2:54 am     Reply with quote

hi....

Here is the first lines of my code.


#include<16f877.h>
#include<stdio.h>
#include<F877.h>

#device PIC16F877 *=16 ADC=10 // I get an error here

#fuses XT,NOWDT,NOPROTECT, NOBROWNOUT, NOLVP
#use delay(clock= 4000000)

#ZERO_RAM
#priority ext, rb
#include"lcd.c"

thanks a lot for an answer

poorly
poorly
Guest







new version
PostPosted: Tue Aug 10, 2004 2:54 am     Reply with quote

hi....

Here is the first lines of my code.


#include<16f877.h>
#include<stdio.h>
#include<F877.h>

#device PIC16F877 *=16 ADC=10 // I get an error here

#fuses XT,NOWDT,NOPROTECT, NOBROWNOUT, NOLVP
#use delay(clock= 4000000)

#ZERO_RAM
#priority ext, rb
#include"lcd.c"

thanks a lot for an answer

poorly
kypec



Joined: 20 Sep 2003
Posts: 54

View user's profile Send private message

PICmicro device is defined twice
PostPosted: Wed Aug 11, 2004 12:08 am     Reply with quote

You must omit the device declaration at
the 4th line, i.e. instead of
Code:
#device PIC16F877 *=16 ADC=10

it should read only
Code:
#device *=16 ADC=10

because the type of PIC itself is already defined
in the include file 16f877.h and it cannot
be redefined later even if you use the same device type Wink

good luck,
kypec
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