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

how to read and setup the analog channel for PIC16f628

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







how to read and setup the analog channel for PIC16f628
PostPosted: Sat Oct 22, 2005 1:30 pm     Reply with quote

i use 16f628. for my program, i want to read the analog input from the analog input pin and set the ccp function. i have the problems to setting the adc of the pic. how to read the analog input from the input pin and to setup the adc. i used the common setup like

setup_adc_ports(ALL_ANALOG);
set_adc_channel(1);

and
read_adc()

to access the adc ports butwhen the program is compiled, the reply is that undefined identifier occured. do i need to change the header file for this type of PIC16f628 as i only got the default header. if i need to change the header file, how to do it Question

hope u guys can help me with this. tq
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Oct 22, 2005 1:49 pm     Reply with quote

As was covered extensively in an earlier post just a week or so ago there are NO ADCs in the 16F628, the ANx pins are analog COMPARATORS!!!! PLEASE READ THE DATASHEET.

If you want to use ADCs try a different chip.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Oct 22, 2005 1:50 pm     Reply with quote

The 16F628 doesn't have an A/D converter.
See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=24753&start=15
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