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

device type

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







device type
PostPosted: Tue Aug 15, 2006 11:56 pm     Reply with quote

Dear Sir,
The following code shows the error message "can not change the device type so far into this code". but when i deleted the below code and retype it again the error message goes. but after two or three compile without doing any change the error message again appears. is it ccs compiler misbehaviong?


#include <16F877A> #DEVICE ADC=10 *=16
#FUSES XT,WDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay(clock=2000000)
theteaman



Joined: 04 Aug 2006
Posts: 98

View user's profile Send private message

PostPosted: Wed Aug 16, 2006 12:16 am     Reply with quote

are you sure you want #device adc=10 *=16?? doesn't seem to make sense to me?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 16, 2006 12:58 am     Reply with quote

The #device line should go directly below the #include line.
Also, no spaces should be present between any of the characters
in the sequences of "ADC=10" or "*=16". If you put a space
in there, you will get an instant "Can't change device this far
into code" error.

#include <16F877A.H>
#DEVICE ADC=10 *=16
#FUSES XT,WDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay(clock=2000000)

Also, are you really running at 2 MHz as shown in your post ?
Or is supposed to be 20 MHz ? If so, you need to be using the HS
fuse instead of XT.

Do you really need to run the Watchdog Timer ? You have it enabled.
If you enable it, then you need to place a restart_wdt() statement
(or more than one statement) in your program at appropriate locations.
I recommend using NOWDT, until you understand this better.
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