|
|
View previous topic :: View next topic |
Author |
Message |
poorly Guest
|
new version of CCS |
Posted: Sat Aug 07, 2004 12:10 pm |
|
|
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: 1934 Location: Norman, OK
|
Show us the first part of your code |
Posted: Sat Aug 07, 2004 12:27 pm |
|
|
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 |
Posted: Sun Aug 08, 2004 9:58 am |
|
|
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 |
Posted: Tue Aug 10, 2004 2:54 am |
|
|
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 |
Posted: Tue Aug 10, 2004 2:54 am |
|
|
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
|
PICmicro device is defined twice |
Posted: Wed Aug 11, 2004 12:08 am |
|
|
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
good luck,
kypec |
|
|
|
|
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
|