View previous topic :: View next topic |
Author |
Message |
Monk9514524 Guest
|
why compiler always stop in #device ADC=10 |
Posted: Thu Nov 27, 2008 9:06 am |
|
|
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
|
the usual drill |
Posted: Thu Nov 27, 2008 9:15 am |
|
|
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
|
|
Posted: Thu Nov 27, 2008 10:08 am |
|
|
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
|
here is an EASY thing to test |
Posted: Thu Nov 27, 2008 12:08 pm |
|
|
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
|
|
|
|