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 support@ccsinfo.com

why compiler always stop in #device ADC=10

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







why compiler always stop in #device ADC=10
PostPosted: Thu Nov 27, 2008 9:06 am     Reply with quote

hello guys

I have a problem that my program doesn't compile.
Always stop in the #device ADC=10
and the complier show me the error "Can not change this device into this code". What happen?

Did anybody have run into this ?
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

the usual drill
PostPosted: Thu Nov 27, 2008 9:15 am     Reply with quote

post enough info for it to be figured out.
FACTS needed
1- what pic ?
2- your compiler version
3- enough of your source code that shows all this
starting from you top of file includes

then a good answer can be given

but a first guess is that you are programming a pic with only 8 bit A/D hardware.
Ttelmah
Guest







PostPosted: Thu Nov 27, 2008 10:08 am     Reply with quote

The error message is what you will get, if you include almost anything except the processor definition file and fuses before this line.
Order:

Processor definition file
Fuse declarations
Device settings
Clock settings
RS232, SPI etc. setups.

Only then start including the library files

Then the main code
Obviously, lines 2,3,4,5, can themselves be combined into a single include file, but the order must basically remain the same.

Best Wishes
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

here is an EASY thing to test
PostPosted: Thu Nov 27, 2008 12:08 pm     Reply with quote

you can also try this :

1- find the .H file for your pic

the first executable line should look like this

#DEVICE=16F886

2- edit it to be:
#DEVICE=16F886 ADC=10

3- then remove the isolated #DEVICE ADC=10 from your main prog file
AND compile again

otherwise - submit more info
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Nov 27, 2008 12:59 pm     Reply with quote

You don't have to edit the .H file. See the sample code in this thread
which shows how to use the A/D:
http://www.ccsinfo.com/forum/viewtopic.php?t=32168
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