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

ADC-Help me

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



Joined: 24 Mar 2006
Posts: 1
Location: Vietnam

View user's profile Send private message Yahoo Messenger

ADC-Help me
PostPosted: Sun Mar 26, 2006 9:54 pm     Reply with quote

Hi!
I'm studying ADC PIC16F877A.Who can help me?

Why is there a faulse in this code
Code:
 #device PIC16F877A *=16 ADC = 10


Thanks!
Ttelmah
Guest







PostPosted: Mon Mar 27, 2006 5:58 am     Reply with quote

There isn't...
However it depends on what else is in the code,and where you put it. To use the standard 'defines', you need:
#include <16F877A.H>

as the first line of your code.
If you then try to set the processor 'type', you will get a complaint, since it is already set in this include file.
So:

#include <16F877A.H>
#device *=16 ADC=10

As the first two lines of the code, is the normal way of including the standard defines, and setting the options you need.

Best Wishes
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Mon Mar 27, 2006 7:54 am     Reply with quote

Also, the compiler doesn't like spaces around the '=' in the device declarations. You get the "Can't change device type this far into code" error message.
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