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 ADC=10" showing error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
[email protected]



Joined: 13 Jan 2014
Posts: 1

View user's profile Send private message

Need help........
PostPosted: Mon Jan 13, 2014 4:53 am     Reply with quote

i am using ccs 5 compiler , for pic16f877a, i have problems with adc
when i use this pre processor directive "#DEVICE ADC=10" it showing error , is there any other options for using 10 bit resolution adc.. plese help me..........
Ttelmah



Joined: 11 Mar 2010
Posts: 19568

View user's profile Send private message

PostPosted: Mon Jan 13, 2014 8:13 am     Reply with quote

#DEVICE ADC=10, is correct

Key is though it must be right at the top of the code. So:
Code:

#include <16F877A.h>                           
#device ADC=10
#fuses HS,NOWDT,NOPROTECT,NOLVP               
#use delay(clock=20000000)                     
#use rs232(baud=9600, UART1, ERRORS)


It _won't_ be accepted, if it is after other things. It'll work after the fuses, but not after the delay, and/or the RS232 declaration.

Best Wishes
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