how to read and setup the analog channel for PIC16f628
Posted: Sat Oct 22, 2005 1:30 pm
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
hope u guys can help me with this. tq
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
Posted: Sat Oct 22, 2005 1:49 pm
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.
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